@@ -8,12 +8,12 @@ var stripFullStack = require('./common').stripFullStack;
8
8
9
9
var tapeBin = 'node ' + path . join ( __dirname , '../bin/tape' ) ;
10
10
11
- var expectedExitCodeFailure = ( / ^ 0 \. 1 0 \. \d + $ / ) . test ( process . versions . node ) ;
12
11
var expectedStackTraceBug = ( / ^ 3 \. [ 0 1 2 ] \. \d + $ / ) . test ( process . versions . node ) ; // https://github.com/nodejs/node/issues/2581
12
+ var expectedExitCodeOnError = ( / ^ 0 \. (?: 9 | 1 0 ) / ) . test ( process . versions . node ) ? 8 : 1 ; // node v0.9 sets this exit code to 8, for some reason
13
13
14
14
tap . test (
15
15
'Should throw error when --no-only is passed via cli and there is a .only test' ,
16
- { todo : expectedExitCodeFailure || expectedStackTraceBug ? 'Fails on these node versions' : false } ,
16
+ { todo : expectedStackTraceBug ? 'Fails on these node versions' : false } ,
17
17
function ( tt ) {
18
18
tt . plan ( 3 ) ;
19
19
@@ -22,14 +22,14 @@ tap.test(
22
22
} , function ( err , stdout , stderr ) {
23
23
tt . same ( stdout . toString ( 'utf8' ) , '' ) ;
24
24
tt . match ( stripFullStack ( stderr . toString ( 'utf8' ) ) . join ( '\n' ) , / E r r o r : ` o n l y ` t e s t s a r e p r o h i b i t e d \n / ) ;
25
- tt . equal ( err . code , 1 ) ;
25
+ tt . equal ( err . code , expectedExitCodeOnError ) ;
26
26
} ) ;
27
27
}
28
28
) ;
29
29
30
30
tap . test (
31
31
'Should throw error when NODE_TAPE_NO_ONLY_TEST is passed via envs and there is an .only test' ,
32
- { todo : expectedExitCodeFailure || expectedStackTraceBug ? 'Fails on these node versions' : false } ,
32
+ { todo : expectedStackTraceBug ? 'Fails on these node versions' : false } ,
33
33
function ( tt ) {
34
34
tt . plan ( 3 ) ;
35
35
@@ -39,14 +39,14 @@ tap.test(
39
39
} , function ( err , stdout , stderr ) {
40
40
tt . same ( stdout . toString ( 'utf8' ) , '' ) ;
41
41
tt . match ( stripFullStack ( stderr . toString ( 'utf8' ) ) . join ( '\n' ) , / E r r o r : ` o n l y ` t e s t s a r e p r o h i b i t e d \n / ) ;
42
- tt . equal ( err . code , 1 ) ;
42
+ tt . equal ( err . code , expectedExitCodeOnError ) ;
43
43
} ) ;
44
44
}
45
45
) ;
46
46
47
47
tap . test (
48
48
'Should override NODE_TAPE_NO_ONLY_TEST env if --no-only is passed from cli' ,
49
- { todo : expectedExitCodeFailure || expectedStackTraceBug ? 'Fails on these node versions' : false } ,
49
+ { todo : expectedStackTraceBug ? 'Fails on these node versions' : false } ,
50
50
function ( tt ) {
51
51
tt . plan ( 3 ) ;
52
52
@@ -56,7 +56,7 @@ tap.test(
56
56
} , function ( err , stdout , stderr ) {
57
57
tt . same ( stdout . toString ( 'utf8' ) , '' ) ;
58
58
tt . match ( stripFullStack ( stderr . toString ( 'utf8' ) ) . join ( '\n' ) , / E r r o r : ` o n l y ` t e s t s a r e p r o h i b i t e d \n / ) ;
59
- tt . equal ( err . code , 1 ) ;
59
+ tt . equal ( err . code , expectedExitCodeOnError ) ;
60
60
} ) ;
61
61
}
62
62
) ;
0 commit comments