@@ -147,8 +147,7 @@ class WPTTestSpec {
147
147
* 'test.any.js'
148
148
* @param {StatusRule[] } rules
149
149
*/
150
- constructor ( mod , filename , rules , version ) {
151
- this . version = version ;
150
+ constructor ( mod , filename , rules ) {
152
151
this . module = mod ;
153
152
this . filename = filename ;
154
153
@@ -161,17 +160,8 @@ class WPTTestSpec {
161
160
this . requires . add ( req ) ;
162
161
}
163
162
}
164
- switch ( this . version ) {
165
- case 1 :
166
- if ( item . fail ) {
167
- this . failReasons . push ( item . fail ) ;
168
- }
169
- break ;
170
- case 2 :
171
- default :
172
- if ( Array . isArray ( item . fail ?. expected ) ) {
173
- this . failReasons . push ( ...item . fail . expected ) ;
174
- }
163
+ if ( Array . isArray ( item . fail ?. expected ) ) {
164
+ this . failReasons . push ( ...item . fail . expected ) ;
175
165
}
176
166
if ( item . skip ) {
177
167
this . skipReasons . push ( item . skip ) ;
@@ -270,15 +260,15 @@ class StatusLoader {
270
260
load ( ) {
271
261
const dir = path . join ( __dirname , '..' , 'wpt' ) ;
272
262
const statusFile = path . join ( dir , 'status' , `${ this . path } .json` ) ;
273
- const { '$version' : version , ... result } = JSON . parse ( fs . readFileSync ( statusFile , 'utf8' ) ) ;
263
+ const result = JSON . parse ( fs . readFileSync ( statusFile , 'utf8' ) ) ;
274
264
this . rules . addRules ( result ) ;
275
265
276
266
const subDir = fixtures . path ( 'wpt' , this . path ) ;
277
267
const list = this . grep ( subDir ) ;
278
268
for ( const file of list ) {
279
269
const relativePath = path . relative ( subDir , file ) ;
280
270
const match = this . rules . match ( relativePath ) ;
281
- this . specs . push ( new WPTTestSpec ( this . path , relativePath , match , version ) ) ;
271
+ this . specs . push ( new WPTTestSpec ( this . path , relativePath , match ) ) ;
282
272
}
283
273
this . loaded = true ;
284
274
}
@@ -606,15 +596,7 @@ class WPTRunner {
606
596
607
597
fail ( filename , test , status ) {
608
598
const spec = this . specMap . get ( filename ) ;
609
- let expected ;
610
- switch ( spec . version ) {
611
- case 1 :
612
- expected = ! ! ( spec . failReasons . length ) ;
613
- break ;
614
- case 2 :
615
- default :
616
- expected = spec . failReasons . includes ( test . message || reason ) ;
617
- }
599
+ const expected = spec . failReasons . includes ( test . message || reason ) ;
618
600
if ( expected ) {
619
601
console . log ( `[EXPECTED_FAILURE][${ status . toUpperCase ( ) } ] ${ test . name } ` ) ;
620
602
console . log ( test . message || reason ) ;
0 commit comments