Skip to content

Commit

Permalink
fix: failing test plus change wording in output
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Pena committed Aug 28, 2024
1 parent be3dcf2 commit 721f0dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const analyze = async ({ dir, apply = [], ignore = [], exclude, groupBy,
output.push({ info: `${BG_INFO}Analyzing Vue, TS and JS files in ${dir}${BG_RESET}` })
output.push({
info: `${applyingMessage}
Ignoring ${ignoredRulesets.length} rules/rulesets: ${ignoreRulesetsOutput}
Ignoring ${ignoredRulesets.length} rules: ${ignoreRulesetsOutput}
Excluding ${exclude || '-'}
Output level ${BG_INFO}${level}${BG_RESET}
Grouping by ${BG_INFO}${groupBy}${BG_RESET}
Expand Down
11 changes: 8 additions & 3 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ describe('yarn analyze command with default configuration', () => {
expect(stdout).toContain('Analyzing Vue, TS and JS files in ')
})

it.todo('should error out when both apply and ignore are used', async () => {
const { stderr } = await execa('yarn', ['analyze', '--ignore=vue-strong', '--apply=rrd'])
expect(stderr).toContain('Cannot use both --ignore and --apply options together.')
it('should error out when both apply and ignore are used', async () => {
try {
await execa('yarn', ['analyze', '--ignore=vue-strong', '--apply=rrd'])
}
catch (error: any) {
expect(error.stderr).toContain('Cannot use both --ignore and --apply options together.')
expect(error.exitCode).toBe(1)
}
})

it('should report error for invalid ignore rulesets and exit with code 1', async () => {
Expand Down

0 comments on commit 721f0dc

Please sign in to comment.