@@ -11,10 +11,13 @@ describe('socket config unset', async () => {
1111 // Lazily access constants.rootBinPath.
1212 const entryPath = path . join ( constants . rootBinPath , `${ CLI } .js` )
1313
14- cmdit ( [ 'config' , 'unset' , '--help' ] , 'should support --help' , async cmd => {
15- const { code, stderr, stdout } = await invokeNpm ( entryPath , cmd )
16- expect ( stdout ) . toMatchInlineSnapshot (
17- `
14+ cmdit (
15+ [ 'config' , 'unset' , '--help' , '--config' , '{}' ] ,
16+ 'should support --help' ,
17+ async cmd => {
18+ const { code, stderr, stdout } = await invokeNpm ( entryPath , cmd )
19+ expect ( stdout ) . toMatchInlineSnapshot (
20+ `
1821 "Clear the value of a local CLI config item
1922
2023 Usage
@@ -37,23 +40,24 @@ describe('socket config unset', async () => {
3740 Examples
3841 $ socket config unset FakeOrg --repoName=test-repo"
3942 `
40- )
41- expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
43+ )
44+ expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
4245 "
4346 _____ _ _ /---------------
4447 | __|___ ___| |_ ___| |_ | Socket.dev CLI ver <redacted>
4548 |__ | . | _| '_| -_| _| | Node: <redacted>, API token set: <redacted>
4649 |_____|___|___|_,_|___|_|.dev | Command: \`socket config unset\`, cwd: <redacted>"
4750 ` )
4851
49- expect ( code , 'help should exit with code 2' ) . toBe ( 2 )
50- expect ( stderr , 'header should include command (without params)' ) . toContain (
51- '`socket config unset`'
52- )
53- } )
52+ expect ( code , 'help should exit with code 2' ) . toBe ( 2 )
53+ expect ( stderr , 'banner includes base command' ) . toContain (
54+ '`socket config unset`'
55+ )
56+ }
57+ )
5458
5559 cmdit (
56- [ 'config' , 'unset' , '--dry-run' ] ,
60+ [ 'config' , 'unset' , '--dry-run' , '--config' , '{}' ] ,
5761 'should require args with just dry-run' ,
5862 async cmd => {
5963 const { code, stderr, stdout } = await invokeNpm ( entryPath , cmd )
@@ -75,7 +79,7 @@ describe('socket config unset', async () => {
7579 )
7680
7781 cmdit (
78- [ 'config' , 'unset' , 'test' , '--dry-run' ] ,
82+ [ 'config' , 'unset' , 'test' , '--dry-run' , '--config' , '{}' ] ,
7983 'should require args with just dry-run' ,
8084 async cmd => {
8185 const { code, stderr, stdout } = await invokeNpm ( entryPath , cmd )
0 commit comments