@@ -2,7 +2,7 @@ import semver from 'semver'
2
2
import { describe , expect } from 'vitest'
3
3
4
4
import constants from '../../../src/constants.mts'
5
- import { cmdit , spawnPnpm } from '../../../test/utils.mts'
5
+ import { cmdit , spawnSocketCli } from '../../../test/utils.mts'
6
6
7
7
describe ( 'socket analytics' , async ( ) => {
8
8
const { binCliPath } = constants
@@ -11,7 +11,7 @@ describe('socket analytics', async () => {
11
11
[ 'analytics' , '--help' , '--config' , '{}' ] ,
12
12
'should support --help' ,
13
13
async cmd => {
14
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
14
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
15
15
expect ( stdout ) . toMatchInlineSnapshot (
16
16
`
17
17
"Look up analytics data
@@ -65,7 +65,7 @@ describe('socket analytics', async () => {
65
65
[ 'analytics' , '--dry-run' , '--config' , '{}' ] ,
66
66
'should report missing token with just dry-run' ,
67
67
async cmd => {
68
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
68
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
69
69
expect ( stdout ) . toMatchInlineSnapshot ( `""` )
70
70
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
71
71
"
@@ -97,7 +97,7 @@ describe('socket analytics', async () => {
97
97
] ,
98
98
'should reject legacy flags' ,
99
99
async cmd => {
100
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
100
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
101
101
expect ( stdout ) . toMatchInlineSnapshot ( `""` )
102
102
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
103
103
"
@@ -120,7 +120,7 @@ describe('socket analytics', async () => {
120
120
[ 'analytics' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
121
121
'should run to dryrun without args' ,
122
122
async cmd => {
123
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
123
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
124
124
expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
125
125
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
126
126
"
@@ -138,7 +138,7 @@ describe('socket analytics', async () => {
138
138
[ 'analytics' , 'org' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
139
139
'should accept org arg' ,
140
140
async cmd => {
141
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
141
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
142
142
expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
143
143
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
144
144
"
@@ -156,7 +156,7 @@ describe('socket analytics', async () => {
156
156
[ 'analytics' , 'repo' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
157
157
'should ask for repo name with repo arg' ,
158
158
async cmd => {
159
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
159
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
160
160
expect ( stdout ) . toMatchInlineSnapshot ( `""` )
161
161
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
162
162
"
@@ -186,7 +186,7 @@ describe('socket analytics', async () => {
186
186
] ,
187
187
'should accept repo with arg' ,
188
188
async cmd => {
189
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
189
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
190
190
expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
191
191
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
192
192
"
@@ -204,7 +204,7 @@ describe('socket analytics', async () => {
204
204
[ 'analytics' , '7' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
205
205
'should accept time 7 arg' ,
206
206
async cmd => {
207
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
207
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
208
208
expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
209
209
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
210
210
"
@@ -222,7 +222,7 @@ describe('socket analytics', async () => {
222
222
[ 'analytics' , '30' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
223
223
'should accept time 30 arg' ,
224
224
async cmd => {
225
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
225
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
226
226
expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
227
227
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
228
228
"
@@ -240,7 +240,7 @@ describe('socket analytics', async () => {
240
240
[ 'analytics' , '90' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
241
241
'should accept time 90 arg' ,
242
242
async cmd => {
243
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
243
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
244
244
expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
245
245
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
246
246
"
@@ -266,7 +266,7 @@ describe('socket analytics', async () => {
266
266
] ,
267
267
'should report legacy flag' ,
268
268
async cmd => {
269
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
269
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
270
270
expect ( stdout ) . toMatchInlineSnapshot ( `""` )
271
271
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
272
272
"
@@ -296,7 +296,7 @@ describe('socket analytics', async () => {
296
296
] ,
297
297
'should accept org and time arg' ,
298
298
async cmd => {
299
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
299
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
300
300
expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
301
301
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
302
302
"
@@ -322,7 +322,7 @@ describe('socket analytics', async () => {
322
322
] ,
323
323
'should accept repo and time arg' ,
324
324
async cmd => {
325
- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
325
+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
326
326
expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
327
327
expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
328
328
"
0 commit comments