@@ -16,7 +16,7 @@ describe('Regression Tests', function() {
1616 ] ,
1717 notInclude : [
1818 'Donate to Wikipedia'
19- ]
19+ ] ,
2020 } ,
2121 {
2222 fixture : 'mediashift' ,
@@ -80,11 +80,48 @@ describe('Regression Tests', function() {
8080 '最赞回应' ,
8181 '最新话题' ,
8282 '北京豆网科技有限公司' ,
83- ]
83+ ] ,
84+ } ,
85+ {
86+ fixture : 'ifeng' ,
87+ title : '熊玲:什么样的婚姻才是鸡肋婚姻?' ,
88+ include : [
89+ '沃尔沃“憋”不住了,最高狂降8万,性能不输BBA,白菜价愣没人' ,
90+ '打开APP' ,
91+ ] ,
92+ notInclude : [
93+ '它是“迷恋婚姻又排拒婚姻”的一种复杂婚姻情感心理状态。它意味着即便你有千条理由走出婚姻,背后却有万种吸引力把你留在围城里。' ,
94+ '在婚姻十字路口的人,你若要想你们的关系和好如初,就必须有重修婚姻的姿态,即必须有妥协的态度。' ,
95+ '重修婚姻的办法很多很多,但最简单也是最核心的办法只有一个,那就是接受。' ,
96+ ] ,
97+ } ,
98+ {
99+ fixture : 'ifeng' ,
100+ title : '熊玲:什么样的婚姻才是鸡肋婚姻?' ,
101+ include : [
102+ '它是“迷恋婚姻又排拒婚姻”的一种复杂婚姻情感心理状态。它意味着即便你有千条理由走出婚姻,背后却有万种吸引力把你留在围城里。' ,
103+ '在婚姻十字路口的人,你若要想你们的关系和好如初,就必须有重修婚姻的姿态,即必须有妥协的态度。' ,
104+ '重修婚姻的办法很多很多,但最简单也是最核心的办法只有一个,那就是接受。' ,
105+ ] ,
106+ notInclude : [
107+ '沃尔沃“憋”不住了,最高狂降8万,性能不输BBA,白菜价愣没人' ,
108+ '打开APP' ,
109+ ] ,
110+ options : {
111+ candidatesFilters : [
112+ function ( elem ) {
113+ if ( elem . tagName === 'ARTICLE' && elem . getAttribute ( 'type' ) === 'video' ) {
114+ return false ;
115+ }
116+
117+ return true ;
118+ }
119+ ] ,
120+ } ,
84121 } ] . forEach ( function ( testCase ) {
85122 it ( 'can extract ' + testCase . fixture + ' articles' , function ( done ) {
86123 var html = fs . readFileSync ( articleFixtures + '/' + testCase . fixture + '.html' ) . toString ( ) ;
87- read ( html , function ( error , article ) {
124+ read ( html , testCase . options || { } , function ( error , article ) {
88125 if ( error ) {
89126 done ( error )
90127 } else {
0 commit comments