Skip to content

Commit

Permalink
fix e2e v2
Browse files Browse the repository at this point in the history
  • Loading branch information
dbale-altoros committed May 11, 2024
1 parent d86157f commit 1e65c0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Solhint changed how the exit codes are implemented:
#### Solhint QUIET mode
QUIET mode (-c quiet) option now works with the warnings and may exit with 1 if there are more than defined by user

Thanks to [@juanpcapurro](https://github.com/juanpcapurro) for providing the code

<br><br>
## [4.5.4] - 2024-04-10
Expand Down
17 changes: 8 additions & 9 deletions e2e/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,23 @@ describe('e2e', function () {
})

it('should show warning when using --init', function () {
const { code, stdout } = shell.exec(`${NODE}solhint --init`)

const { code, stderr } = shell.exec(`${NODE}solhint --init`)
expect(code).to.equal(EXIT_CODES.BAD_OPTIONS)
expect(stdout.trim()).to.equal('Configuration file already exists')
expect(stderr).to.equal('Configuration file already exists')
})
})

describe('no-empty-blocks', function () {
const PATH = '03-no-empty-blocks'
const { PREFIX, SUFFIX } = prepareContext(PATH)

describe('No contracts to lint', function () {
it('should fail with appropiate message', function () {
const { code, stderr } = shell.exec(`${NODE}solhint Foo.sol ${SUFFIX}`)

it('No contracts to lint should fail with appropiate message', function () {
const { code, stderr } = shell.exec(`${NODE}solhint Foo1.sol ${SUFFIX}`)

expect(code).to.equal(EXIT_CODES.BAD_OPTIONS)
expect(stderr).to.include('No files to lint!')
})
})

it('should end with REPORTED_ERRORS = 1 because report contains errors', function () {
const { code, stdout } = shell.exec(`${NODE}solhint ${PREFIX}Foo.sol ${SUFFIX}`)
Expand Down Expand Up @@ -213,9 +211,10 @@ describe('e2e', function () {

it(`should raise error for wrongFunctionDefinitionName() only`, () => {
const SUFFIX2 = `-c ${PREFIX}test/.solhint.json --disc`

const { code, stdout } = shell.exec(`${NODE}solhint ${PREFIX}test/FooTest.sol ${SUFFIX2}`)

expect(code).to.equal(EXIT_CODES.OK)
expect(code).to.equal(EXIT_CODES.REPORTED_ERRORS)
expect(stdout.trim()).to.contain(
'Function wrongFunctionDefinitionName() must match Foundry test naming convention '
)
Expand Down

0 comments on commit 1e65c0d

Please sign in to comment.