@@ -36,28 +36,24 @@ describe("Solhint plugin", function () {
36
36
) ;
37
37
} ) ;
38
38
39
- it ( "should run the check task and exit" , async function ( ) {
39
+ it ( "should run the check task and set the exit code to 1 " , async function ( ) {
40
40
const consoleLogStub = sinon . stub ( console , "log" ) ;
41
- const processExitStub = sinon . stub ( process , "exit" ) ;
42
41
await this . env . run ( "check" ) ;
43
42
assert . isTrue ( consoleLogStub . calledOnce ) ;
44
- assert . isTrue ( processExitStub . calledOnceWith ( 1 ) ) ;
43
+ assert . strictEqual ( process . exitCode , 1 ) ;
45
44
consoleLogStub . restore ( ) ;
46
- processExitStub . restore ( ) ;
45
+ process . exitCode = undefined ;
47
46
} ) ;
48
47
} ) ;
49
48
50
49
describe ( "Project with no errors" , function ( ) {
51
50
useEnvironment ( "no-errors-project" ) ;
52
51
53
- it ( "should run the check task and not exit" , async function ( ) {
52
+ it ( "should run the check task and not set the exit code " , async function ( ) {
54
53
const consoleLogStub = sinon . stub ( console , "log" ) ;
55
- const processExitStub = sinon . stub ( process , "exit" ) ;
56
54
await this . env . run ( "check" ) ;
57
55
assert . isTrue ( consoleLogStub . calledOnce ) ;
58
- assert . isTrue ( processExitStub . notCalled ) ;
59
- consoleLogStub . restore ( ) ;
60
- processExitStub . restore ( ) ;
56
+ assert . strictEqual ( process . exitCode , undefined ) ;
61
57
} ) ;
62
58
} ) ;
63
59
0 commit comments