@@ -438,26 +438,28 @@ Object.keys(cases).forEach(caseName => {
438
438
describe ( caseName , ( ) => {
439
439
let ep = 0 ;
440
440
441
- cases [ caseName ] . fixtures . forEach ( assertionName => {
442
- if ( cases [ caseName ] . only ) {
441
+ let testcase = cases [ caseName ] ;
442
+
443
+ testcase . fixtures . forEach ( assertionName => {
444
+ if ( testcase . only ) {
443
445
it . only ( assertionName , ( ) => {
444
- test ( caseName , cases , assertionName , ep ) ;
446
+ test ( testcase , assertionName , ep ) ;
445
447
} ) ;
446
- } else if ( cases [ caseName ] . skip ) {
448
+ } else if ( testcase . skip ) {
447
449
it . skip ( assertionName , ( ) => { } ) ;
448
450
} else {
449
451
it ( assertionName , ( ) => {
450
- test ( caseName , cases , assertionName , ep ) ;
452
+ test ( testcase , assertionName , ep ) ;
451
453
} ) ;
452
454
}
453
455
} ) ;
454
456
} ) ;
455
457
} ) ;
456
458
457
459
458
- function test ( caseName , cases , assertionName , ep ) {
460
+ function test ( testcase , assertionName , ep ) {
459
461
let sample = fs . readFileSync ( `./fixtures/${ assertionName } /sample.js` , 'utf-8' ) ;
460
- let options = cases [ caseName ] . transformOptions ;
462
+ let options = testcase . transformOptions ;
461
463
let expectationPath = `./fixtures/${ assertionName } /expectation.js` ;
462
464
let expectationExists = fs . existsSync ( expectationPath ) ;
463
465
@@ -468,6 +470,6 @@ function test(caseName, cases, assertionName, ep) {
468
470
469
471
} else {
470
472
let fn = ( ) => transform ( sample , options ) ;
471
- expect ( fn ) . to . throw ( new RegExp ( cases [ caseName ] . errors [ ep ++ ] ) ) ;
473
+ expect ( fn ) . to . throw ( new RegExp ( testcase . errors [ ep ++ ] ) ) ;
472
474
}
473
475
}
0 commit comments