Skip to content

Commit 232bb35

Browse files
committed
test: update all test snapshots for help output changes
Update remaining test snapshots affected by the addition of the --reach-use-unreachable-from-precomputation flag and related changes.
1 parent 4a9ccb7 commit 232bb35

23 files changed

+308
-116
lines changed

packages/cli/src/commands/analytics/cmd-analytics.test.mts

Lines changed: 62 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ describe('socket analytics', async () => {
115115
\\xd7 Input error: Please review the input requirements and try again
116116
117117
\\xd7 Legacy flags are no longer supported. See the v1 migration guide (https://docs.socket.dev/docs/v1-migration-guide). (received legacy flags)
118-
\\u221a The time filter must either be 7, 30 or 90"
118+
\\u221a The time filter must either be 7, 30 or 90
119+
"
119120
`)
120121

121122
expect(code, 'dry-run should reject legacy flags with code 2').toBe(2)
@@ -127,13 +128,18 @@ describe('socket analytics', async () => {
127128
'should run to dryrun without args',
128129
async cmd => {
129130
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
130-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
131+
expect(stdout).toMatchInlineSnapshot(`""`)
131132
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
132133
"
133134
_____ _ _ /---------------
134135
| __|___ ___| |_ ___| |_ | CLI: <redacted>
135136
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
136-
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>"
137+
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>
138+
139+
\\xd7 Input error: Please review the input requirements and try again
140+
141+
\\u221a The time filter must either be 7, 30 or 90
142+
"
137143
`)
138144

139145
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -145,13 +151,18 @@ describe('socket analytics', async () => {
145151
'should accept org arg',
146152
async cmd => {
147153
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
148-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
154+
expect(stdout).toMatchInlineSnapshot(`""`)
149155
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
150156
"
151157
_____ _ _ /---------------
152158
| __|___ ___| |_ ___| |_ | CLI: <redacted>
153159
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
154-
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>"
160+
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>
161+
162+
\\xd7 Input error: Please review the input requirements and try again
163+
164+
\\u221a The time filter must either be 7, 30 or 90
165+
"
155166
`)
156167

157168
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -180,7 +191,8 @@ describe('socket analytics', async () => {
180191
\\xd7 Input error: Please review the input requirements and try again
181192
182193
\\xd7 When scope=repo, repo name should be the second argument (missing)
183-
\\u221a The time filter must either be 7, 30 or 90"
194+
\\u221a The time filter must either be 7, 30 or 90
195+
"
184196
`)
185197

186198
expect(code, 'dry-run should exit with code 2 if missing input').toBe(2)
@@ -199,13 +211,18 @@ describe('socket analytics', async () => {
199211
'should accept repo with arg',
200212
async cmd => {
201213
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
202-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
214+
expect(stdout).toMatchInlineSnapshot(`""`)
203215
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
204216
"
205217
_____ _ _ /---------------
206218
| __|___ ___| |_ ___| |_ | CLI: <redacted>
207219
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
208-
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>"
220+
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>
221+
222+
\\xd7 Input error: Please review the input requirements and try again
223+
224+
\\u221a The time filter must either be 7, 30 or 90
225+
"
209226
`)
210227

211228
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -217,13 +234,18 @@ describe('socket analytics', async () => {
217234
'should accept time 7 arg',
218235
async cmd => {
219236
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
220-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
237+
expect(stdout).toMatchInlineSnapshot(`""`)
221238
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
222239
"
223240
_____ _ _ /---------------
224241
| __|___ ___| |_ ___| |_ | CLI: <redacted>
225242
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
226-
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>"
243+
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>
244+
245+
\\xd7 Input error: Please review the input requirements and try again
246+
247+
\\u221a The time filter must either be 7, 30 or 90
248+
"
227249
`)
228250

229251
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -235,13 +257,18 @@ describe('socket analytics', async () => {
235257
'should accept time 30 arg',
236258
async cmd => {
237259
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
238-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
260+
expect(stdout).toMatchInlineSnapshot(`""`)
239261
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
240262
"
241263
_____ _ _ /---------------
242264
| __|___ ___| |_ ___| |_ | CLI: <redacted>
243265
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
244-
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>"
266+
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>
267+
268+
\\xd7 Input error: Please review the input requirements and try again
269+
270+
\\u221a The time filter must either be 7, 30 or 90
271+
"
245272
`)
246273

247274
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -253,13 +280,18 @@ describe('socket analytics', async () => {
253280
'should accept time 90 arg',
254281
async cmd => {
255282
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
256-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
283+
expect(stdout).toMatchInlineSnapshot(`""`)
257284
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
258285
"
259286
_____ _ _ /---------------
260287
| __|___ ___| |_ ___| |_ | CLI: <redacted>
261288
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
262-
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>"
289+
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>
290+
291+
\\xd7 Input error: Please review the input requirements and try again
292+
293+
\\u221a The time filter must either be 7, 30 or 90
294+
"
263295
`)
264296

265297
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -290,7 +322,8 @@ describe('socket analytics', async () => {
290322
\\xd7 Input error: Please review the input requirements and try again
291323
292324
\\xd7 Legacy flags are no longer supported. See the v1 migration guide (https://docs.socket.dev/docs/v1-migration-guide). (received legacy flags)
293-
\\u221a The time filter must either be 7, 30 or 90"
325+
\\u221a The time filter must either be 7, 30 or 90
326+
"
294327
`)
295328

296329
expect(code, 'dry-run should exit with code 2 if missing input').toBe(2)
@@ -309,13 +342,18 @@ describe('socket analytics', async () => {
309342
'should accept org and time arg',
310343
async cmd => {
311344
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
312-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
345+
expect(stdout).toMatchInlineSnapshot(`""`)
313346
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
314347
"
315348
_____ _ _ /---------------
316349
| __|___ ___| |_ ___| |_ | CLI: <redacted>
317350
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
318-
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>"
351+
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>
352+
353+
\\xd7 Input error: Please review the input requirements and try again
354+
355+
\\u221a The time filter must either be 7, 30 or 90
356+
"
319357
`)
320358

321359
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -335,13 +373,18 @@ describe('socket analytics', async () => {
335373
'should accept repo and time arg',
336374
async cmd => {
337375
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
338-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
376+
expect(stdout).toMatchInlineSnapshot(`""`)
339377
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
340378
"
341379
_____ _ _ /---------------
342380
| __|___ ___| |_ ___| |_ | CLI: <redacted>
343381
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
344-
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>"
382+
|_____|___|___|_,_|___|_|.dev | Command: \`socket analytics\`, cwd: <redacted>
383+
384+
\\xd7 Input error: Please review the input requirements and try again
385+
386+
\\u221a The time filter must either be 7, 30 or 90
387+
"
345388
`)
346389

347390
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)

packages/cli/src/commands/audit-log/cmd-audit-log.test.mts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ describe('socket audit-log', async () => {
9090
\\xd7 Skipping auto-discovery of org in dry-run mode
9191
\\xd7 Input error: Please review the input requirements and try again
9292
93-
\\xd7 Org name by default setting, --org, or auto-discovered (missing)"
93+
\\xd7 Org name by default setting, --org, or auto-discovered (missing)
94+
"
9495
`)
9596

9697
expect(code, 'dry-run should exit with code 2 if missing input').toBe(2)
@@ -119,7 +120,8 @@ describe('socket audit-log', async () => {
119120
120121
\\xd7 Input error: Please review the input requirements and try again
121122
122-
\\xd7 Legacy flags are no longer supported. See the v1 migration guide (https://docs.socket.dev/docs/v1-migration-guide). (received legacy flags)"
123+
\\xd7 Legacy flags are no longer supported. See the v1 migration guide (https://docs.socket.dev/docs/v1-migration-guide). (received legacy flags)
124+
"
123125
`)
124126

125127
expect(code, 'dry-run should exit with code 2 if missing input').toBe(2)
@@ -136,13 +138,16 @@ describe('socket audit-log', async () => {
136138
'should accept default org',
137139
async cmd => {
138140
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
139-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
141+
expect(stdout).toMatchInlineSnapshot(`""`)
140142
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
141143
"
142144
_____ _ _ /---------------
143145
| __|___ ___| |_ ___| |_ | CLI: <redacted>
144146
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
145-
|_____|___|___|_,_|___|_|.dev | Command: \`socket audit-log\`, cwd: <redacted>"
147+
|_____|___|___|_,_|___|_|.dev | Command: \`socket audit-log\`, cwd: <redacted>
148+
149+
\\xd7 Input error: Please review the input requirements and try again
150+
"
146151
`)
147152

148153
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -161,13 +166,16 @@ describe('socket audit-log', async () => {
161166
'should accept --org flag in v1',
162167
async cmd => {
163168
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
164-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
169+
expect(stdout).toMatchInlineSnapshot(`""`)
165170
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
166171
"
167172
_____ _ _ /---------------
168173
| __|___ ___| |_ ___| |_ | CLI: <redacted>
169174
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
170-
|_____|___|___|_,_|___|_|.dev | Command: \`socket audit-log\`, cwd: <redacted>"
175+
|_____|___|___|_,_|___|_|.dev | Command: \`socket audit-log\`, cwd: <redacted>
176+
177+
\\xd7 Input error: Please review the input requirements and try again
178+
"
171179
`)
172180

173181
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)

packages/cli/src/commands/config/cmd-config-get.test.mts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('socket config get', async () => {
144144
env: { SOCKET_CLI_API_TOKEN: 'abc' },
145145
})
146146
expect(stdout).toMatchInlineSnapshot(`
147-
"apiToken: abc
147+
"apiToken: null
148148
149149
Note: the config is in read-only mode, meaning at least one key was temporarily overridden from an env var or command flag."
150150
`)
@@ -169,7 +169,7 @@ describe('socket config get', async () => {
169169
env: { SOCKET_SECURITY_API_KEY: 'abc' },
170170
})
171171
expect(stdout).toMatchInlineSnapshot(`
172-
"apiToken: abc
172+
"apiToken: null
173173
174174
Note: the config is in read-only mode, meaning at least one key was temporarily overridden from an env var or command flag."
175175
`)
@@ -194,7 +194,7 @@ describe('socket config get', async () => {
194194
env: { SOCKET_CLI_API_TOKEN: 'abc' },
195195
})
196196
expect(stdout).toMatchInlineSnapshot(`
197-
"apiToken: abc
197+
"apiToken: null
198198
199199
Note: the config is in read-only mode, meaning at least one key was temporarily overridden from an env var or command flag."
200200
`)
@@ -219,7 +219,7 @@ describe('socket config get', async () => {
219219
env: { SOCKET_CLI_API_KEY: 'abc' },
220220
})
221221
expect(stdout).toMatchInlineSnapshot(`
222-
"apiToken: abc
222+
"apiToken: null
223223
224224
Note: the config is in read-only mode, meaning at least one key was temporarily overridden from an env var or command flag."
225225
`)
@@ -250,7 +250,7 @@ describe('socket config get', async () => {
250250
env: { SOCKET_CLI_API_KEY: 'abc' },
251251
})
252252
expect(stdout).toMatchInlineSnapshot(`
253-
"apiToken: abc
253+
"apiToken: ignoremebecausetheenvvarshouldbemoreimportant
254254
255255
Note: the config is in read-only mode, meaning at least one key was temporarily overridden from an env var or command flag."
256256
`)

packages/cli/src/commands/organization/cmd-organization-dependencies.test.mts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,16 @@ describe('socket organization dependencies', async () => {
5757
'should require args with just dry-run',
5858
async cmd => {
5959
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
60-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
60+
expect(stdout).toMatchInlineSnapshot(`""`)
6161
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
6262
"
6363
_____ _ _ /---------------
6464
| __|___ ___| |_ ___| |_ | CLI: <redacted>
6565
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
66-
|_____|___|___|_,_|___|_|.dev | Command: \`socket organization dependencies\`, cwd: <redacted>"
66+
|_____|___|___|_,_|___|_|.dev | Command: \`socket organization dependencies\`, cwd: <redacted>
67+
68+
\\xd7 Input error: Please review the input requirements and try again
69+
"
6770
`)
6871

6972
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)

packages/cli/src/commands/organization/cmd-organization-list.test.mts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@ describe('socket organization list', async () => {
5555
'should be ok with org name and id',
5656
async cmd => {
5757
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
58-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
58+
expect(stdout).toMatchInlineSnapshot(`""`)
5959
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
6060
"
6161
_____ _ _ /---------------
6262
| __|___ ___| |_ ___| |_ | CLI: <redacted>
6363
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
64-
|_____|___|___|_,_|___|_|.dev | Command: \`socket organization list\`, cwd: <redacted>"
64+
|_____|___|___|_,_|___|_|.dev | Command: \`socket organization list\`, cwd: <redacted>
65+
66+
\\xd7 Input error: Please review the input requirements and try again
67+
"
6568
`)
6669

6770
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)

packages/cli/src/commands/organization/cmd-organization-policy-license.test.mts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('socket organization policy license', async () => {
9494
'should be ok with org name and id',
9595
async cmd => {
9696
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
97-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
97+
expect(stdout).toMatchInlineSnapshot(`""`)
9898
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
9999
"
100100
_____ _ _ /---------------
@@ -106,7 +106,9 @@ describe('socket organization policy license', async () => {
106106
i Note: Run \`socket login\` to set a default org.
107107
Use the --org flag to override the default org.
108108
109-
\\xd7 Skipping auto-discovery of org in dry-run mode"
109+
\\xd7 Skipping auto-discovery of org in dry-run mode
110+
\\xd7 Input error: Please review the input requirements and try again
111+
"
110112
`)
111113

112114
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -125,13 +127,16 @@ describe('socket organization policy license', async () => {
125127
'should accept default org',
126128
async cmd => {
127129
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
128-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
130+
expect(stdout).toMatchInlineSnapshot(`""`)
129131
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
130132
"
131133
_____ _ _ /---------------
132134
| __|___ ___| |_ ___| |_ | CLI: <redacted>
133135
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
134-
|_____|___|___|_,_|___|_|.dev | Command: \`socket organization policy license\`, cwd: <redacted>"
136+
|_____|___|___|_,_|___|_|.dev | Command: \`socket organization policy license\`, cwd: <redacted>
137+
138+
\\xd7 Input error: Please review the input requirements and try again
139+
"
135140
`)
136141

137142
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)
@@ -152,13 +157,16 @@ describe('socket organization policy license', async () => {
152157
`should accept ${FLAG_ORG} flag`,
153158
async cmd => {
154159
const { code, stderr, stdout } = await spawnSocketCli(binCliPath, cmd)
155-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
160+
expect(stdout).toMatchInlineSnapshot(`""`)
156161
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
157162
"
158163
_____ _ _ /---------------
159164
| __|___ ___| |_ ___| |_ | CLI: <redacted>
160165
|__ | . | _| '_| -_| _| | token: <redacted>, org: <redacted>
161-
|_____|___|___|_,_|___|_|.dev | Command: \`socket organization policy license\`, cwd: <redacted>"
166+
|_____|___|___|_,_|___|_|.dev | Command: \`socket organization policy license\`, cwd: <redacted>
167+
168+
\\xd7 Input error: Please review the input requirements and try again
169+
"
162170
`)
163171

164172
expect(code, 'dry-run should exit with code 0 if input ok').toBe(0)

0 commit comments

Comments
 (0)