-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix errors with space-separated include/exclude arg
- Loading branch information
Showing
2 changed files
with
48 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import assert from 'node:assert/strict'; | ||
import test from 'node:test'; | ||
import { resolve } from '../src/util/path.js'; | ||
import { execFactory } from './helpers/exec.js'; | ||
|
||
const cwd = resolve('fixtures/cli'); | ||
|
||
const exec = execFactory(cwd); | ||
|
||
test('knip --include files,dependencies', () => { | ||
const { stdout, status } = exec('knip --include files,dependencies'); | ||
assert.equal(stdout, ''); | ||
assert.equal(status, 0); | ||
}); | ||
|
||
test('knip --include files --include dependencies', () => { | ||
const { stdout, status } = exec('knip --include files --include dependencies'); | ||
assert.equal(stdout, ''); | ||
assert.equal(status, 0); | ||
}); | ||
|
||
test('knip --include file,dep', () => { | ||
const { stderr, status } = exec('knip --include file,dep'); | ||
assert.match(stderr, /Invalid issue type: file/); | ||
assert.equal(status, 2); | ||
}); | ||
|
||
test('knip --include files --include deps', () => { | ||
const { stderr, status } = exec('knip --include files,deps'); | ||
assert.match(stderr, /Invalid issue type: deps/); | ||
assert.equal(status, 2); | ||
}); |