@@ -86,7 +86,7 @@ describe('e2e', function () {
8686
8787 it ( 'should show warning when using --init' , function ( ) {
8888 const { code, stderr } = shell . exec ( `${ NODE } solhint --init` )
89-
89+
9090 expect ( code ) . to . equal ( EXIT_CODES . BAD_OPTIONS )
9191 expect ( stderr ) . to . include ( 'Configuration file already exists' )
9292 } )
@@ -96,12 +96,12 @@ describe('e2e', function () {
9696 const PATH = '03-no-empty-blocks'
9797 const { PREFIX , SUFFIX } = prepareContext ( PATH )
9898
99- it ( 'No contracts to lint should fail with appropiate message' , function ( ) {
100- const { code, stderr } = shell . exec ( `${ NODE } solhint Foo1.sol ${ SUFFIX } ` )
101-
102- expect ( code ) . to . equal ( EXIT_CODES . BAD_OPTIONS )
103- expect ( stderr ) . to . include ( 'No files to lint!' )
104- } )
99+ it ( 'No contracts to lint should fail with appropiate message' , function ( ) {
100+ const { code, stderr } = shell . exec ( `${ NODE } solhint Foo1.sol ${ SUFFIX } ` )
101+
102+ expect ( code ) . to . equal ( EXIT_CODES . BAD_OPTIONS )
103+ expect ( stderr ) . to . include ( 'No files to lint!' )
104+ } )
105105
106106 it ( 'should end with REPORTED_ERRORS = 1 because report contains errors' , function ( ) {
107107 const { code, stdout } = shell . exec ( `${ NODE } solhint ${ PREFIX } Foo.sol ${ SUFFIX } ` )
@@ -193,6 +193,14 @@ describe('e2e', function () {
193193
194194 expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
195195 } )
196+
197+ it ( 'should exit with code 1 if one of evaluated contracts contains errors' , function ( ) {
198+ const { code } = shell . exec (
199+ `${ NODE } solhint ${ PREFIX } contracts/Foo.sol ${ PREFIX } contracts/Foo2.sol ${ SUFFIX } `
200+ )
201+
202+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
203+ } )
196204 } )
197205
198206 describe ( 'Linter - foundry-test-functions with shell' , ( ) => {
@@ -211,7 +219,7 @@ describe('e2e', function () {
211219
212220 it ( `should raise error for wrongFunctionDefinitionName() only` , ( ) => {
213221 const SUFFIX2 = `-c ${ PREFIX } test/.solhint.json --disc`
214-
222+
215223 const { code, stdout } = shell . exec ( `${ NODE } solhint ${ PREFIX } test/FooTest.sol ${ SUFFIX2 } ` )
216224
217225 expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
0 commit comments