File tree 1 file changed +18
-1
lines changed
packages/hardhat-solhint/test
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,28 @@ describe("Solhint plugin", function () {
36
36
) ;
37
37
} ) ;
38
38
39
- it ( "should run the check task without throwing an error " , async function ( ) {
39
+ it ( "should run the check task and exit " , async function ( ) {
40
40
const consoleLogStub = sinon . stub ( console , "log" ) ;
41
+ const processExitStub = sinon . stub ( process , "exit" ) ;
41
42
await this . env . run ( "check" ) ;
42
43
assert . isTrue ( consoleLogStub . calledOnce ) ;
44
+ assert . isTrue ( processExitStub . calledOnceWith ( 1 ) ) ;
43
45
consoleLogStub . restore ( ) ;
46
+ processExitStub . restore ( ) ;
47
+ } ) ;
48
+ } ) ;
49
+
50
+ describe ( "Project with no errors" , function ( ) {
51
+ useEnvironment ( "no-errors-project" ) ;
52
+
53
+ it ( "should run the check task and not exit" , async function ( ) {
54
+ const consoleLogStub = sinon . stub ( console , "log" ) ;
55
+ const processExitStub = sinon . stub ( process , "exit" ) ;
56
+ await this . env . run ( "check" ) ;
57
+ assert . isTrue ( consoleLogStub . calledOnce ) ;
58
+ assert . isTrue ( processExitStub . notCalled ) ;
59
+ consoleLogStub . restore ( ) ;
60
+ processExitStub . restore ( ) ;
44
61
} ) ;
45
62
} ) ;
46
63
You can’t perform that action at this time.
0 commit comments