Skip to content

Commit

Permalink
chore: add test case for
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Zhao <[email protected]>
  • Loading branch information
zhaoyuheng200 committed Oct 17, 2023
1 parent 302b464 commit 63ce589
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/cli/cli_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,27 @@ describe('cli', function () {
false
)
)
const [actual, actual2, actual3] = await Promise.all([
const [paramTest1, paramTest2, paramTest3, pathTest1] = await Promise.all([
execAsync(`${repolinterPath} lint ${selfPath} -r repolinter-other.json`),
execAsync(
`${repolinterPath} lint ${selfPath} --rulesetFile repolinter-other.json`
),
execAsync(
`${repolinterPath} lint ${selfPath} --ruleset-file repolinter-other.json`
),
execAsync(
`${repolinterPath} lint ${selfPath}/bin --ruleset-file tests/cli/repolinter-other.json`
)
])

expect(actual.code).to.equal(0)
expect(actual2.code).to.equal(0)
expect(actual3.code).to.equal(0)
expect(actual.out.trim()).to.equals(expected.trim())
expect(actual2.out.trim()).to.equals(expected.trim())
expect(actual3.out.trim()).to.equals(expected.trim())
expect(paramTest1.code).to.equal(0)
expect(paramTest2.code).to.equal(0)
expect(paramTest3.code).to.equal(0)
expect(pathTest1.code).to.equal(0)
expect(paramTest1.out.trim()).to.equals(expected.trim())
expect(paramTest2.out.trim()).to.equals(expected.trim())
expect(paramTest3.out.trim()).to.equals(expected.trim())
expect(pathTest1.out.trim()).to.equals(expected.trim())
})

it('runs repolinter from the CLI using a YAML config file', async () => {
Expand Down

0 comments on commit 63ce589

Please sign in to comment.