@@ -2,7 +2,7 @@ import semver from 'semver'
22import { describe , expect } from 'vitest'
33
44import constants from '../../../src/constants.mts'
5- import { cmdit , spawnPnpm } from '../../../test/utils.mts'
5+ import { cmdit , spawnSocketCli } from '../../../test/utils.mts'
66
77describe ( 'socket analytics' , async ( ) => {
88 const { binCliPath } = constants
@@ -11,7 +11,7 @@ describe('socket analytics', async () => {
1111 [ 'analytics' , '--help' , '--config' , '{}' ] ,
1212 'should support --help' ,
1313 async cmd => {
14- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
14+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
1515 expect ( stdout ) . toMatchInlineSnapshot (
1616 `
1717 "Look up analytics data
@@ -65,7 +65,7 @@ describe('socket analytics', async () => {
6565 [ 'analytics' , '--dry-run' , '--config' , '{}' ] ,
6666 'should report missing token with just dry-run' ,
6767 async cmd => {
68- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
68+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
6969 expect ( stdout ) . toMatchInlineSnapshot ( `""` )
7070 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
7171 "
@@ -97,7 +97,7 @@ describe('socket analytics', async () => {
9797 ] ,
9898 'should reject legacy flags' ,
9999 async cmd => {
100- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
100+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
101101 expect ( stdout ) . toMatchInlineSnapshot ( `""` )
102102 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
103103 "
@@ -120,7 +120,7 @@ describe('socket analytics', async () => {
120120 [ 'analytics' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
121121 'should run to dryrun without args' ,
122122 async cmd => {
123- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
123+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
124124 expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
125125 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
126126 "
@@ -138,7 +138,7 @@ describe('socket analytics', async () => {
138138 [ 'analytics' , 'org' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
139139 'should accept org arg' ,
140140 async cmd => {
141- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
141+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
142142 expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
143143 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
144144 "
@@ -156,7 +156,7 @@ describe('socket analytics', async () => {
156156 [ 'analytics' , 'repo' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
157157 'should ask for repo name with repo arg' ,
158158 async cmd => {
159- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
159+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
160160 expect ( stdout ) . toMatchInlineSnapshot ( `""` )
161161 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
162162 "
@@ -186,7 +186,7 @@ describe('socket analytics', async () => {
186186 ] ,
187187 'should accept repo with arg' ,
188188 async cmd => {
189- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
189+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
190190 expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
191191 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
192192 "
@@ -204,7 +204,7 @@ describe('socket analytics', async () => {
204204 [ 'analytics' , '7' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
205205 'should accept time 7 arg' ,
206206 async cmd => {
207- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
207+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
208208 expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
209209 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
210210 "
@@ -222,7 +222,7 @@ describe('socket analytics', async () => {
222222 [ 'analytics' , '30' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
223223 'should accept time 30 arg' ,
224224 async cmd => {
225- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
225+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
226226 expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
227227 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
228228 "
@@ -240,7 +240,7 @@ describe('socket analytics', async () => {
240240 [ 'analytics' , '90' , '--dry-run' , '--config' , '{"apiToken":"fakeToken"}' ] ,
241241 'should accept time 90 arg' ,
242242 async cmd => {
243- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
243+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
244244 expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
245245 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
246246 "
@@ -266,7 +266,7 @@ describe('socket analytics', async () => {
266266 ] ,
267267 'should report legacy flag' ,
268268 async cmd => {
269- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
269+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
270270 expect ( stdout ) . toMatchInlineSnapshot ( `""` )
271271 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
272272 "
@@ -296,7 +296,7 @@ describe('socket analytics', async () => {
296296 ] ,
297297 'should accept org and time arg' ,
298298 async cmd => {
299- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
299+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
300300 expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
301301 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
302302 "
@@ -322,7 +322,7 @@ describe('socket analytics', async () => {
322322 ] ,
323323 'should accept repo and time arg' ,
324324 async cmd => {
325- const { code, stderr, stdout } = await spawnPnpm ( binCliPath , cmd )
325+ const { code, stderr, stdout } = await spawnSocketCli ( binCliPath , cmd )
326326 expect ( stdout ) . toMatchInlineSnapshot ( `"[DryRun]: Bailing now"` )
327327 expect ( `\n ${ stderr } ` ) . toMatchInlineSnapshot ( `
328328 "
0 commit comments