@@ -12,26 +12,26 @@ tmpdir.refresh();
12
12
13
13
describe ( 'node:test bail' , ( ) => {
14
14
it ( 'should exit at first failure' , async ( ) => {
15
- const child = spawnSync ( process . execPath , [ '--test' , '--test-bail=1' , testFile ] ) ;
16
- console . log ( child . stdout . toString ( ) ) ;
15
+ const child = spawnSync ( process . execPath , [ '--test' , '--test-bail' , testFile ] ) ;
17
16
assert . strictEqual ( child . stderr . toString ( ) , '' ) ;
18
- assert . match ( child . stdout . toString ( ) , / T A P v e r s i o n 1 3 / ) ;
19
- assert . match ( child . stdout . toString ( ) , / o k 1 - o k / ) ;
20
- assert . match ( child . stdout . toString ( ) , / n o t o k 2 - f a i l i n g / ) ;
17
+ assert . match ( child . stdout . toString ( ) , / o k 1 - f i r s t / ) ;
18
+ assert . match ( child . stdout . toString ( ) , / n o t o k 2 - s e c o n d / ) ;
19
+ assert . match ( child . stdout . toString ( ) , / o k 3 - t h i r d / ) ;
21
20
assert . match ( child . stdout . toString ( ) , / n o t o k 1 - n e s t e d / ) ;
22
- assert . doesNotMatch ( child . stdout . toString ( ) , / n o t o k 2 - t o p l e v e l / ) ;
21
+ assert . doesNotMatch ( child . stdout . toString ( ) , / o k 1 - o k f o r t h / ) ;
22
+ assert . doesNotMatch ( child . stdout . toString ( ) , / n o t o k 2 - f i f t h / ) ;
23
23
assert . doesNotMatch ( child . stdout . toString ( ) , / S u b t e s t : t o p l e v e l / ) ;
24
24
} ) ;
25
25
26
- it ( 'should exit at second failure' , async ( ) => {
27
- const child = spawnSync ( process . execPath , [ '--test' , '--test-bail=2' , testFile ] ) ;
28
- console . log ( child . stdout . toString ( ) ) ;
26
+ it ( 'should exit not exit if bail isnt set' , async ( ) => {
27
+ const child = spawnSync ( process . execPath , [ '--test' , testFile ] ) ;
29
28
assert . strictEqual ( child . stderr . toString ( ) , '' ) ;
30
- assert . match ( child . stdout . toString ( ) , / T A P v e r s i o n 1 3 / ) ;
31
- assert . match ( child . stdout . toString ( ) , / o k 1 - o k / ) ;
32
- assert . match ( child . stdout . toString ( ) , / n o t o k 2 - f a i l i n g / ) ;
29
+ assert . match ( child . stdout . toString ( ) , / o k 1 - f i r s t / ) ;
30
+ assert . match ( child . stdout . toString ( ) , / n o t o k 2 - s e c o n d / ) ;
31
+ assert . match ( child . stdout . toString ( ) , / n o t o k 3 - t h i r d / ) ;
33
32
assert . match ( child . stdout . toString ( ) , / n o t o k 1 - n e s t e d / ) ;
34
- assert . match ( child . stdout . toString ( ) , / n o t o k 2 - f a i l i n g / ) ;
35
- assert . match ( child . stdout . toString ( ) , / S u b t e s t : t o p l e v e l / ) ;
33
+ assert . match ( child . stdout . toString ( ) , / o k 1 - f o r t h / ) ;
34
+ assert . match ( child . stdout . toString ( ) , / n o t o k 2 - f i f t h / ) ;
35
+ assert . match ( child . stdout . toString ( ) , / n o t o k 2 - t o p l e v e l / ) ;
36
36
} ) ;
37
37
} ) ;
0 commit comments