@@ -7,40 +7,44 @@ import { cmdit, invokeNpm } from '../../../test/utils'
77
88const { CLI } = constants
99
10- describe ( 'socket oops ' , async ( ) => {
10+ describe ( 'socket ci ' , async ( ) => {
1111 // Lazily access constants.rootBinPath.
1212 const entryPath = path . join ( constants . rootBinPath , `${ CLI } .js` )
1313
1414 cmdit (
15- [ 'oops ' , '--help' , '--config' , '{}' ] ,
15+ [ 'ci ' , '--help' , '--config' , '{}' ] ,
1616 'should support --help' ,
1717 async cmd => {
1818 const { code, stderr, stdout } = await invokeNpm ( entryPath , cmd )
1919 expect ( stdout ) . toMatchInlineSnapshot (
2020 `
21- "Trigger an intentional error (for development)
21+ "Create a new scan and report whether it passes your security policy
2222
23- Usage
24- $ socket oops oops
23+ Usage
24+ $ socket ci
2525
26- Don't run me."
27- `
26+ This command is intended to use in CI runs to allow automated systems to
27+ accept or reject a current build. When the scan does not pass your security
28+ policy, the exit code will be non-zero.
29+
30+ It will use the default org for the set API token."
31+ `
2832 )
2933 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
30- "
31- _____ _ _ /---------------
32- | __|___ ___| |_ ___| |_ | Socket.dev CLI ver <redacted>
33- |__ | . | _| '_| -_| _| | Node: <redacted>, API token set: <redacted>
34- |_____|___|___|_,_|___|_|.dev | Command: \`socket oops \`, cwd: <redacted>"
35- ` )
34+ "
35+ _____ _ _ /---------------
36+ | __|___ ___| |_ ___| |_ | Socket.dev CLI ver <redacted>
37+ |__ | . | _| '_| -_| _| | Node: <redacted>, API token set: <redacted>
38+ |_____|___|___|_,_|___|_|.dev | Command: \`socket ci \`, cwd: <redacted>"
39+ ` )
3640
3741 expect ( code , 'help should exit with code 2' ) . toBe ( 2 )
38- expect ( stderr , 'banner includes base command' ) . toContain ( '`socket oops `' )
42+ expect ( stderr , 'banner includes base command' ) . toContain ( '`socket ci `' )
3943 }
4044 )
4145
4246 cmdit (
43- [ 'oops ' , '--dry-run' , '--config' , '{"apiToken":"anything"}' ] ,
47+ [ 'ci ' , '--dry-run' , '--config' , '{"apiToken":"anything"}' ] ,
4448 'should require args with just dry-run' ,
4549 async cmd => {
4650 const { code, stderr, stdout } = await invokeNpm ( entryPath , cmd )
@@ -50,7 +54,7 @@ describe('socket oops', async () => {
5054 _____ _ _ /---------------
5155 | __|___ ___| |_ ___| |_ | Socket.dev CLI ver <redacted>
5256 |__ | . | _| '_| -_| _| | Node: <redacted>, API token set: <redacted>
53- |_____|___|___|_,_|___|_|.dev | Command: \`socket oops \`, cwd: <redacted>"
57+ |_____|___|___|_,_|___|_|.dev | Command: \`socket ci \`, cwd: <redacted>"
5458 ` )
5559
5660 expect ( code , 'dry-run should exit with code 0 if input ok' ) . toBe ( 0 )
0 commit comments