-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathdlx.test.mts
More file actions
618 lines (526 loc) · 21.7 KB
/
Copy pathdlx.test.mts
File metadata and controls
618 lines (526 loc) · 21.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
import { promises as fs } from 'node:fs'
import { createRequire } from 'node:module'
import os from 'node:os'
import path from 'node:path'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { spawn } from '@socketsecurity/registry/lib/spawn'
import constants from '../constants.mts'
import { spawnCoanaDlx, spawnDlx } from './dlx.mts'
import type { DlxPackageSpec } from './dlx.mts'
const require = createRequire(import.meta.url)
vi.mock('@socketsecurity/registry/lib/spawn', () => ({
spawn: vi.fn(),
}))
vi.mock('./sdk.mts', () => ({
getDefaultApiToken: () => undefined,
getDefaultProxyUrl: () => undefined,
}))
vi.mock('../commands/ci/fetch-default-org-slug.mts', () => ({
getDefaultOrgSlug: async () => ({ ok: false }),
}))
describe('utils/dlx', () => {
describe('spawnDlx', () => {
let mockShadowPnpmBin: ReturnType<typeof vi.fn>
let mockShadowNpxBin: ReturnType<typeof vi.fn>
let mockShadowYarnBin: ReturnType<typeof vi.fn>
beforeEach(() => {
// Create mock functions that return a promise with spawnPromise.
const createMockBin = () =>
vi.fn().mockResolvedValue({
spawnPromise: Promise.resolve({ stdout: '', stderr: '' }),
})
mockShadowPnpmBin = createMockBin()
mockShadowNpxBin = createMockBin()
mockShadowYarnBin = createMockBin()
// Mock the require calls for shadow binaries.
vi.spyOn(require, 'resolve').mockImplementation((id: string) => {
if (id === constants.shadowPnpmBinPath) {
return id
}
if (id === constants.shadowNpxBinPath) {
return id
}
if (id === constants.shadowYarnBinPath) {
return id
}
throw new Error(`Unexpected require: ${id}`)
})
// @ts-ignore
require.cache[constants.shadowPnpmBinPath] = {
exports: mockShadowPnpmBin,
}
// @ts-ignore
require.cache[constants.shadowNpxBinPath] = { exports: mockShadowNpxBin }
// @ts-ignore
require.cache[constants.shadowYarnBinPath] = {
exports: mockShadowYarnBin,
}
})
afterEach(() => {
vi.restoreAllMocks()
// Clean up require cache.
// @ts-ignore
delete require.cache[constants.shadowPnpmBinPath]
// @ts-ignore
delete require.cache[constants.shadowNpxBinPath]
// @ts-ignore
delete require.cache[constants.shadowYarnBinPath]
})
it('should place --silent before dlx for pnpm', async () => {
const packageSpec: DlxPackageSpec = {
name: '@coana-tech/cli',
version: '1.0.0',
}
await spawnDlx(packageSpec, ['run', '/some/path'], {
agent: 'pnpm',
silent: true,
})
expect(mockShadowPnpmBin).toHaveBeenCalledTimes(1)
const [spawnArgs] = mockShadowPnpmBin.mock.calls[0]
// Verify that --silent comes before dlx.
expect(spawnArgs[0]).toBe('--silent')
expect(spawnArgs[1]).toBe('dlx')
expect(spawnArgs[2]).toBe('@coana-tech/cli@1.0.0')
expect(spawnArgs[3]).toBe('run')
expect(spawnArgs[4]).toBe('/some/path')
})
it('should not add --silent for pnpm when silent is false', async () => {
const packageSpec: DlxPackageSpec = {
name: '@coana-tech/cli',
version: '1.0.0',
}
await spawnDlx(packageSpec, ['run', '/some/path'], {
agent: 'pnpm',
silent: false,
})
expect(mockShadowPnpmBin).toHaveBeenCalledTimes(1)
const [spawnArgs] = mockShadowPnpmBin.mock.calls[0]
// Verify that --silent is not present.
expect(spawnArgs[0]).toBe('dlx')
expect(spawnArgs[1]).toBe('@coana-tech/cli@1.0.0')
expect(spawnArgs[2]).toBe('run')
expect(spawnArgs[3]).toBe('/some/path')
})
it('should default silent to true for pnpm when version is not pinned', async () => {
const packageSpec: DlxPackageSpec = {
name: '@coana-tech/cli',
version: '~1.0.0',
}
await spawnDlx(packageSpec, ['run', '/some/path'], { agent: 'pnpm' })
expect(mockShadowPnpmBin).toHaveBeenCalledTimes(1)
const [spawnArgs] = mockShadowPnpmBin.mock.calls[0]
// Verify that --silent is automatically added for unpinned versions.
expect(spawnArgs[0]).toBe('--silent')
expect(spawnArgs[1]).toBe('dlx')
})
it('should place --silent after --yes for npm', async () => {
const packageSpec: DlxPackageSpec = {
name: '@coana-tech/cli',
version: '1.0.0',
}
await spawnDlx(packageSpec, ['run', '/some/path'], {
agent: 'npm',
silent: true,
})
expect(mockShadowNpxBin).toHaveBeenCalledTimes(1)
const [spawnArgs] = mockShadowNpxBin.mock.calls[0]
// For npm/npx, --yes comes first, then --silent.
expect(spawnArgs[0]).toBe('--yes')
expect(spawnArgs[1]).toBe('--silent')
expect(spawnArgs[2]).toBe('@coana-tech/cli@1.0.0')
expect(spawnArgs[3]).toBe('run')
expect(spawnArgs[4]).toBe('/some/path')
})
it('should set npm_config_dlx_cache_max_age env var for pnpm when force is true', async () => {
const packageSpec: DlxPackageSpec = {
name: '@coana-tech/cli',
version: '1.0.0',
}
await spawnDlx(packageSpec, ['run', '/some/path'], {
agent: 'pnpm',
force: true,
})
expect(mockShadowPnpmBin).toHaveBeenCalledTimes(1)
const [, options] = mockShadowPnpmBin.mock.calls[0]
// Verify that the env var is set to force cache bypass.
expect(options.env).toBeDefined()
expect(options.env.npm_config_dlx_cache_max_age).toBe('0')
})
it('should handle pinned version without silent flag by default', async () => {
const packageSpec: DlxPackageSpec = {
name: '@coana-tech/cli',
version: '1.0.0',
}
await spawnDlx(packageSpec, ['run', '/some/path'], { agent: 'pnpm' })
expect(mockShadowPnpmBin).toHaveBeenCalledTimes(1)
const [spawnArgs] = mockShadowPnpmBin.mock.calls[0]
// For pinned versions, silent defaults to false.
expect(spawnArgs[0]).toBe('dlx')
expect(spawnArgs[1]).toBe('@coana-tech/cli@1.0.0')
})
})
describe('spawnCoanaDlx npm-install fallback', () => {
const mockSpawn = vi.mocked(spawn)
let mockDlxBin: ReturnType<typeof vi.fn>
let installRoot: string
let testCounter = 0
// Each test picks a unique version so they don't share the module-level
// install cache.
const nextVersion = () => `99.0.${testCounter++}`
// Swap the shadow-bin mock to reject with a specific error shape.
// Default beforeEach uses code: 249 / stderr: 'npx aborted'.
const setDlxRejection = (err: Record<string, unknown>) => {
mockDlxBin.mockReset()
mockDlxBin.mockImplementation(async () => {
const rejected = Promise.reject(
Object.assign(new Error('dlx exploded'), err),
)
rejected.catch(() => {})
return { spawnPromise: rejected }
})
}
beforeEach(async () => {
delete process.env['SOCKET_CLI_COANA_FORCE_NPM_INSTALL']
delete process.env['SOCKET_CLI_COANA_DISABLE_NPM_FALLBACK']
delete process.env['SOCKET_CLI_COANA_LOCAL_PATH']
installRoot = await fs.mkdtemp(
path.join(os.tmpdir(), 'socket-coana-test-'),
)
// By default, make whichever shadow bin spawnDlx auto-selects fail so
// the catch path runs. spawnDlx detects the project's PM by lockfile, so
// we mock all three (npm/pnpm/yarn) to the same failing behavior.
// Use mockImplementation so a fresh rejected promise is created per call
// and attach a no-op .catch to suppress Node's unhandled-rejection
// warning (the real handler attaches a microtask later inside the SUT).
mockDlxBin = vi.fn().mockImplementation(async () => {
const rejected = Promise.reject(
Object.assign(new Error('dlx exploded'), {
code: 249,
stderr: 'npx aborted',
}),
)
rejected.catch(() => {})
return { spawnPromise: rejected }
})
for (const binPath of [
constants.shadowNpxBinPath,
constants.shadowPnpmBinPath,
constants.shadowYarnBinPath,
]) {
// @ts-ignore
require.cache[binPath] = { exports: mockDlxBin }
}
// Default behavior: spawn() succeeds for both `npm install` (writing a
// realistic node_modules/@coana-tech/cli/package.json into the tmp
// install dir) and `node` (returning empty stdout). Tests override per
// case via .mockImplementationOnce.
mockSpawn.mockReset()
mockSpawn.mockImplementation(async (cmd: string, args: string[]) => {
if (cmd === 'npm' && args[0] === 'install') {
// Pull --prefix out of args to find the install dir.
const prefixIdx = args.indexOf('--prefix')
const installDir = args[prefixIdx + 1]
const pkgDir = path.join(
installDir,
'node_modules',
'@coana-tech',
'cli',
)
await fs.mkdir(pkgDir, { recursive: true })
await fs.writeFile(
path.join(pkgDir, 'package.json'),
JSON.stringify({ bin: { coana: 'dist/cli.js' } }),
)
return { stdout: '', stderr: '' }
}
// node <script> ...
return { stdout: 'coana-ok', stderr: '' }
})
})
afterEach(async () => {
for (const binPath of [
constants.shadowNpxBinPath,
constants.shadowPnpmBinPath,
constants.shadowYarnBinPath,
]) {
// @ts-ignore
delete require.cache[binPath]
}
vi.restoreAllMocks()
mockSpawn.mockReset()
delete process.env['SOCKET_CLI_COANA_FORCE_NPM_INSTALL']
delete process.env['SOCKET_CLI_COANA_DISABLE_NPM_FALLBACK']
await fs.rm(installRoot, { recursive: true, force: true })
})
it('falls back to npm install + node when dlx throws', async () => {
const version = nextVersion()
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: version,
})
expect(result.ok).toBe(true)
expect(mockDlxBin).toHaveBeenCalledTimes(1)
// npm install was invoked with the expected version.
const npmCalls = mockSpawn.mock.calls.filter(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)
expect(npmCalls).toHaveLength(1)
expect((npmCalls[0]![1] as string[]).at(-1)).toBe(
`@coana-tech/cli@${version}`,
)
// node was then invoked with the resolved bin and the user's args.
const nodeCalls = mockSpawn.mock.calls.filter(([cmd]) => cmd === 'node')
expect(nodeCalls).toHaveLength(1)
const nodeArgs = nodeCalls[0]![1] as string[]
expect(nodeArgs[0]).toMatch(/dist[\\/]cli\.js$/)
expect(nodeArgs.slice(1)).toEqual(['run', '.'])
})
it('caches the install across calls with the same version', async () => {
const version = nextVersion()
const r1 = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: version,
})
const r2 = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: version,
})
expect(r1.ok).toBe(true)
expect(r2.ok).toBe(true)
// Only one npm install — second call reuses the cached path.
const npmInstallCalls = mockSpawn.mock.calls.filter(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)
expect(npmInstallCalls).toHaveLength(1)
// But two node spawns — one per invocation.
const nodeCalls = mockSpawn.mock.calls.filter(([cmd]) => cmd === 'node')
expect(nodeCalls).toHaveLength(2)
})
it('skips fallback when SOCKET_CLI_COANA_DISABLE_NPM_FALLBACK is set', async () => {
process.env['SOCKET_CLI_COANA_DISABLE_NPM_FALLBACK'] = '1'
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(false)
expect(result.message).toContain('Coana command failed')
// No npm install was attempted.
const npmInstallCalls = mockSpawn.mock.calls.filter(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)
expect(npmInstallCalls).toHaveLength(0)
})
it('skips dlx and goes straight to install when SOCKET_CLI_COANA_FORCE_NPM_INSTALL is set', async () => {
process.env['SOCKET_CLI_COANA_FORCE_NPM_INSTALL'] = '1'
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(true)
// dlx (any shadow bin) was never invoked.
expect(mockDlxBin).not.toHaveBeenCalled()
// npm install ran.
const npmInstallCalls = mockSpawn.mock.calls.filter(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)
expect(npmInstallCalls).toHaveLength(1)
})
it('surfaces both dlx and install errors when fallback install fails', async () => {
// Make npm install fail; node would not be reached.
mockSpawn.mockImplementation(async (cmd: string) => {
if (cmd === 'npm') {
throw Object.assign(new Error('install boom'), {
stderr: 'registry unreachable',
})
}
return { stdout: '', stderr: '' }
})
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(false)
expect(result.message).toContain('Coana command failed')
expect(result.message).toContain('npx aborted')
expect(result.message).toContain('npm-install fallback also failed')
expect(result.message).toContain('registry unreachable')
})
it('does NOT fall back on small integer exit codes (likely real Coana failures)', async () => {
// Coana ran and exited with code 1 — a real analysis failure. We want
// the dlx error to propagate as-is without triggering an install retry.
setDlxRejection({ code: 1, stderr: '' })
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(false)
expect(result.message).toContain('exit code 1')
// No npm install was attempted.
const npmInstallCalls = mockSpawn.mock.calls.filter(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)
expect(npmInstallCalls).toHaveLength(0)
})
it('does NOT fall back when captured stderr shows Coana booted', async () => {
// Coana banner present in stderr → Coana clearly ran, so any subsequent
// failure is a real Coana issue, not a launcher problem.
setDlxRejection({
code: 137,
stderr:
'2026-05-22 09:31:34.817 - info: Coana CLI version 15.3.4 scan initiated on .\nfatal: out of memory',
})
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(false)
const npmInstallCalls = mockSpawn.mock.calls.filter(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)
expect(npmInstallCalls).toHaveLength(0)
})
it('falls back on spawn-level errors (ENOENT-style)', async () => {
// npx itself missing from PATH — code is a string, not a number.
setDlxRejection({ code: 'ENOENT' })
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(true)
const npmInstallCalls = mockSpawn.mock.calls.filter(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)
expect(npmInstallCalls).toHaveLength(1)
})
it('falls back when process was killed by signal', async () => {
setDlxRejection({ code: null, signal: 'SIGKILL' })
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(true)
const npmInstallCalls = mockSpawn.mock.calls.filter(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)
expect(npmInstallCalls).toHaveLength(1)
})
it('strips npm_package_* env vars in the fallback to avoid E2BIG in big monorepos', async () => {
// Simulate a parent env polluted with npm_package_* (as set by npm/pnpm
// when running inside a project with a populated package.json). The
// fallback must not pass these through to its npm install or node
// spawns, or the same ARG_MAX overflow that broke the dlx path would
// recur.
process.env['npm_package_name'] = 'forge'
process.env['npm_package_dependencies_react'] = '^18.2.0'
process.env['npm_package_devDependencies_typescript'] = '^5.0.0'
// npm_config_* must be preserved — these carry registry/proxy settings
// sourced from .npmrc and are needed for the nested npm install.
process.env['npm_config_registry'] = 'https://artifactory.example/npm/'
try {
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(true)
const npmInstallCall = mockSpawn.mock.calls.find(
([cmd, args]) => cmd === 'npm' && (args as string[])[0] === 'install',
)!
const nodeCall = mockSpawn.mock.calls.find(([cmd]) => cmd === 'node')!
const npmEnv = (npmInstallCall[2] as { env: NodeJS.ProcessEnv }).env
const nodeEnv = (nodeCall[2] as { env: NodeJS.ProcessEnv }).env
// npm_package_* are stripped from both spawns.
expect(npmEnv['npm_package_name']).toBeUndefined()
expect(npmEnv['npm_package_dependencies_react']).toBeUndefined()
expect(npmEnv['npm_package_devDependencies_typescript']).toBeUndefined()
expect(nodeEnv['npm_package_name']).toBeUndefined()
expect(nodeEnv['npm_package_dependencies_react']).toBeUndefined()
// npm_config_* is preserved (registry override survives).
expect(npmEnv['npm_config_registry']).toBe(
'https://artifactory.example/npm/',
)
expect(nodeEnv['npm_config_registry']).toBe(
'https://artifactory.example/npm/',
)
} finally {
delete process.env['npm_package_name']
delete process.env['npm_package_dependencies_react']
delete process.env['npm_package_devDependencies_typescript']
delete process.env['npm_config_registry']
}
})
})
describe('spawnCoanaDlx stdio + error surfacing', () => {
let mockDlxBin: ReturnType<typeof vi.fn>
let testCounter = 0
// Exact-pinned versions so the dlx silent/force defaults stay deterministic
// and each test stays clear of the module-level install cache.
const nextVersion = () => `98.0.${testCounter++}`
beforeEach(() => {
delete process.env['SOCKET_CLI_COANA_FORCE_NPM_INSTALL']
delete process.env['SOCKET_CLI_COANA_DISABLE_NPM_FALLBACK']
delete process.env['SOCKET_CLI_COANA_LOCAL_PATH']
// The dlx launcher succeeds by default. spawnDlx picks the shadow bin by
// lockfile, so wire all three (npm/pnpm/yarn) to the same mock.
mockDlxBin = vi.fn().mockImplementation(async () => ({
spawnPromise: Promise.resolve({ stdout: 'coana-ok', stderr: '' }),
}))
for (const binPath of [
constants.shadowNpxBinPath,
constants.shadowPnpmBinPath,
constants.shadowYarnBinPath,
]) {
// @ts-ignore
require.cache[binPath] = { exports: mockDlxBin }
}
})
afterEach(() => {
for (const binPath of [
constants.shadowNpxBinPath,
constants.shadowPnpmBinPath,
constants.shadowYarnBinPath,
]) {
// @ts-ignore
delete require.cache[binPath]
}
})
it('forwards spawnExtra.stdio into the dlx launcher options (regression)', async () => {
// `socket manifest gradle` passes `{ stdio: 'inherit' }` as spawnExtra so
// Coana's gradle output streams to the user. Before the fix this was
// dropped — the launcher reads stdio from its options, not the registry
// spawn `extra` arg — so Coana ran piped and the real failure reason was
// hidden behind a bare "command failed".
const result = await spawnCoanaDlx(
['manifest', 'gradle', '.'],
'acme',
{ coanaVersion: nextVersion() },
{ stdio: 'inherit' },
)
expect(result.ok).toBe(true)
expect(mockDlxBin).toHaveBeenCalledTimes(1)
const launcherOptions = mockDlxBin.mock.calls[0]![1] as {
stdio?: unknown
}
expect(launcherOptions.stdio).toBe('inherit')
})
it('forwards options.stdio into the dlx launcher options', async () => {
const result = await spawnCoanaDlx(['run', '.'], 'acme', {
coanaVersion: nextVersion(),
stdio: 'inherit',
})
expect(result.ok).toBe(true)
const launcherOptions = mockDlxBin.mock.calls[0]![1] as {
stdio?: unknown
}
expect(launcherOptions.stdio).toBe('inherit')
})
it('surfaces captured stdout when stderr is empty (Coana logs some failures to stdout)', async () => {
mockDlxBin.mockReset()
mockDlxBin.mockImplementation(async () => {
const rejected = Promise.reject(
Object.assign(new Error('command failed'), {
code: 1,
stdout: 'error: Could not resolve 1 dependency(ies)',
stderr: '',
}),
)
rejected.catch(() => {})
return { spawnPromise: rejected }
})
const result = await spawnCoanaDlx(['manifest', 'gradle', '.'], 'acme', {
coanaVersion: nextVersion(),
})
expect(result.ok).toBe(false)
expect(result.message).toContain('exit code 1')
expect(result.message).toContain('Could not resolve 1 dependency(ies)')
})
})
})