@@ -4,22 +4,17 @@ var run = require('./helpers').runMocha;
44var runJSON = require ( './helpers' ) . runMochaJSON ;
55
66describe ( 'regressions' , function ( ) {
7- it ( 'issue-1327: should run all 3 specs exactly once ' , function ( done ) {
7+ it ( 'issue-1327: should run the first test and then bail ' , function ( done ) {
88 var args = [ ] ;
9- run ( 'regression/issue-1327.fixture.js' , args , function ( err , res ) {
10- var occurences = function ( str ) {
11- var pattern = new RegExp ( str , 'g' ) ;
12- return ( res . output . match ( pattern ) || [ ] ) . length ;
13- } ;
14-
9+ runJSON ( 'regression/issue-1327.fixture.js' , args , function ( err , res ) {
1510 if ( err ) {
16- done ( err ) ;
17- return ;
11+ return done ( err ) ;
1812 }
19- expect ( res , 'to have failed' ) ;
20- expect ( occurences ( 'testbody1' ) , 'to be' , 1 ) ;
21- expect ( occurences ( 'testbody2' ) , 'to be' , 1 ) ;
22- expect ( occurences ( 'testbody3' ) , 'to be' , 1 ) ;
13+ expect ( res , 'to have failed' )
14+ . and ( 'to have passed test count' , 1 )
15+ . and ( 'to have failed test count' , 1 )
16+ . and ( 'to have passed test' , 'test 1' )
17+ . and ( 'to have failed test' , 'test 1' ) ;
2318 done ( ) ;
2419 } ) ;
2520 } ) ;
0 commit comments