@@ -147,8 +147,7 @@ class WPTTestSpec {
147147 * 'test.any.js'
148148 * @param {StatusRule[] } rules
149149 */
150- constructor ( mod , filename , rules , version ) {
151- this . version = version ;
150+ constructor ( mod , filename , rules ) {
152151 this . module = mod ;
153152 this . filename = filename ;
154153
@@ -161,17 +160,8 @@ class WPTTestSpec {
161160 this . requires . add ( req ) ;
162161 }
163162 }
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 ) ;
175165 }
176166 if ( item . skip ) {
177167 this . skipReasons . push ( item . skip ) ;
@@ -270,15 +260,15 @@ class StatusLoader {
270260 load ( ) {
271261 const dir = path . join ( __dirname , '..' , 'wpt' ) ;
272262 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' ) ) ;
274264 this . rules . addRules ( result ) ;
275265
276266 const subDir = fixtures . path ( 'wpt' , this . path ) ;
277267 const list = this . grep ( subDir ) ;
278268 for ( const file of list ) {
279269 const relativePath = path . relative ( subDir , file ) ;
280270 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 ) ) ;
282272 }
283273 this . loaded = true ;
284274 }
@@ -606,15 +596,7 @@ class WPTRunner {
606596
607597 fail ( filename , test , status ) {
608598 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 ) ;
618600 if ( expected ) {
619601 console . log ( `[EXPECTED_FAILURE][${ status . toUpperCase ( ) } ] ${ test . name } ` ) ;
620602 console . log ( test . message || reason ) ;
0 commit comments