-
Notifications
You must be signed in to change notification settings - Fork 553
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: introduce go entry point for snyk code test
- Loading branch information
1 parent
2f3fc5d
commit 234dfea
Showing
2 changed files
with
27 additions
and
1 deletion.
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,25 @@ | ||
import { runSnykCLI } from '../../util/runSnykCLI'; | ||
|
||
describe('code', () => { | ||
it('prints help info', async () => { | ||
const { stdout, code, stderr } = await runSnykCLI('code'); | ||
|
||
expect(stdout).toContain( | ||
'The snyk code test command finds security issues using Static Code Analysis.', | ||
); | ||
expect(code).toBe(0); | ||
expect(stderr).toBe(''); | ||
}); | ||
|
||
describe('test', () => { | ||
jest.setTimeout(60000); | ||
it('supports unknown flags', async () => { | ||
const { stdout, stderr } = await runSnykCLI('code test --unknown-flag'); | ||
|
||
// We do not render the help message for unknown flags | ||
expect(stdout).not.toContain('snyk code test [<OPTIONS>] [<PATH>]'); | ||
expect(stdout).toContain('Testing '); | ||
expect(stderr).toBe(''); | ||
}); | ||
}); | ||
}); |