@@ -7,6 +7,7 @@ const shell = require('shelljs')
77const spawnSync = require ( 'spawn-sync' )
88
99const E2E = true
10+ const EXIT_CODES = { BAD_OPTIONS : 255 , OK : 0 , REPORTED_ERRORS : 1 }
1011
1112let params
1213let currentConfig
@@ -103,7 +104,7 @@ describe('e2e', function () {
103104 }
104105 )
105106
106- expect ( solhintProcess . status ) . to . equal ( 0 )
107+ expect ( solhintProcess . status ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
107108 expect ( solhintProcess . stdout . toString ( ) . includes ( '5 problems (5 errors, 0 warnings)' ) )
108109 } )
109110 } )
@@ -129,7 +130,7 @@ describe('e2e', function () {
129130 `${ params . command } ${ params . param1 } -c ${ currentConfig } ${ currentFile } --fix --disc --noPrompt`
130131 )
131132
132- expect ( code ) . to . equal ( 0 )
133+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
133134
134135 const reportLines = stdout . split ( '\n' )
135136 const finalLine = '5 problems (5 errors, 0 warnings)'
@@ -175,8 +176,8 @@ describe('e2e', function () {
175176 expect ( result ) . to . be . true
176177 } )
177178
178- it ( 'should execute and exit with code 0 (2)' , ( ) => {
179- expect ( code ) . to . equal ( 0 )
179+ it ( 'should execute and exit with code 1 (2)' , ( ) => {
180+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
180181 } )
181182
182183 it ( 'should get the right report (2)' , ( ) => {
@@ -221,8 +222,8 @@ describe('e2e', function () {
221222 expect ( result ) . to . be . true
222223 } )
223224
224- it ( 'should execute and exit with code 1 (3)' , ( ) => {
225- expect ( code ) . to . equal ( 0 )
225+ it ( 'should execute and exit with code 0 (3)' , ( ) => {
226+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
226227 } )
227228
228229 it ( 'should get the right report (3)' , ( ) => {
@@ -268,7 +269,7 @@ describe('e2e', function () {
268269 } )
269270
270271 it ( 'should execute and exit with code 1 (4)' , ( ) => {
271- expect ( code ) . to . equal ( 0 )
272+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
272273 } )
273274
274275 it ( 'should get the right report (4)' , ( ) => {
@@ -314,7 +315,7 @@ describe('e2e', function () {
314315 } )
315316
316317 it ( 'should execute and exit with code 1 (5)' , ( ) => {
317- expect ( code ) . to . equal ( 0 )
318+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
318319 } )
319320
320321 it ( 'should get the right report (5)' , ( ) => {
@@ -361,7 +362,7 @@ describe('e2e', function () {
361362 } )
362363
363364 it ( 'should execute and exit with code 1 (6)' , ( ) => {
364- expect ( code ) . to . equal ( 0 )
365+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
365366 } )
366367
367368 it ( 'should get the right report (6)' , ( ) => {
@@ -401,7 +402,7 @@ describe('e2e', function () {
401402 } )
402403
403404 it ( 'should execute and exit with code 1 (6)' , ( ) => {
404- expect ( code ) . to . equal ( 0 )
405+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
405406 } )
406407
407408 it ( 'should get the right report (6)' , ( ) => {
@@ -448,7 +449,7 @@ describe('e2e', function () {
448449 } )
449450
450451 it ( 'should execute and exit with code 1 (7)' , ( ) => {
451- expect ( code ) . to . equal ( 0 )
452+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
452453 } )
453454
454455 it ( 'should get the right report (7)' , ( ) => {
@@ -494,7 +495,7 @@ describe('e2e', function () {
494495 } )
495496
496497 it ( 'should execute and exit with code 1 (8)' , ( ) => {
497- expect ( code ) . to . equal ( 0 )
498+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
498499 } )
499500
500501 it ( 'should get the right report (8)' , ( ) => {
@@ -540,7 +541,7 @@ describe('e2e', function () {
540541 } )
541542
542543 it ( 'should execute and exit with code 1 (8)' , ( ) => {
543- expect ( code ) . to . equal ( 0 )
544+ expect ( code ) . to . equal ( EXIT_CODES . REPORTED_ERRORS )
544545 } )
545546
546547 it ( 'should get the right report (8)' , ( ) => {
0 commit comments