Skip to content

Commit 17b61cc

Browse files
committed
Update tests
1 parent 14134b9 commit 17b61cc

File tree

5 files changed

+9
-23
lines changed

5 files changed

+9
-23
lines changed

src/commands/manifest/cmd-manifest-cdxgen.test.mts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import path from 'node:path'
22

3-
import semver from 'semver'
43
import { describe, expect, it } from 'vitest'
54

65
import { LOG_SYMBOLS } from '@socketsecurity/registry/lib/logger'
@@ -63,16 +62,10 @@ describe('socket manifest cdxgen', async () => {
6362
.replace(/(?<=CycloneDX\s+Generator\s+)[\d.]+/, '<redacted>')
6463
.replace(/(?<=Node\.js,\s+Version:\s+)[\d.]+/, '<redacted>')
6564

66-
// Node 24 on Windows currently fails this test with assertion failure:
67-
// Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76
68-
const skipStdoutOnWin32Node24 =
69-
constants.WIN32 && semver.parse(constants.NODE_VERSION)!.major >= 24
70-
if (!skipStdoutOnWin32Node24) {
71-
expect(redactedStdout).toMatchInlineSnapshot(`
72-
"CycloneDX Generator <redacted>
73-
Runtime: Node.js, Version: <redacted>"
74-
`)
75-
}
65+
expect(redactedStdout).toMatchInlineSnapshot(`
66+
"CycloneDX Generator <redacted>
67+
Runtime: Node.js, Version: <redacted>"
68+
`)
7669
expect(`\n ${stderr}`).toMatchInlineSnapshot(`
7770
"
7871
_____ _ _ /---------------

src/commands/optimize/cmd-optimize.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ describe('socket optimize', async () => {
375375
const output = stdout + stderr
376376
expect(output).toMatch(/Optimizing|Adding overrides|Finished/i)
377377
},
378-
{ timeout: 60_000 },
378+
{ timeout: 120_000 },
379379
)
380380

381381
cmdit(
@@ -410,7 +410,7 @@ describe('socket optimize', async () => {
410410
const output = stdout + stderr
411411
expect(output).toMatch(/Optimizing|Adding overrides/i)
412412
},
413-
{ timeout: 60_000 },
413+
{ timeout: 120_000 },
414414
)
415415

416416
cmdit(

src/commands/pnpm/cmd-pnpm.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect } from 'vitest'
33
import constants from '../../../src/constants.mts'
44
import { cmdit, spawnSocketCli } from '../../../test/utils.mts'
55

6-
describe('socket pnpm', async () => {
6+
describe.skipIf(constants.WIN32)('socket pnpm', async () => {
77
const { binCliPath } = constants
88

99
cmdit(

src/commands/scan/cmd-scan-reach.test.mts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { describe, expect } from 'vitest'
2-
import semver from 'semver'
32

43
import constants from '../../../src/constants.mts'
54
import { cmdit, spawnSocketCli } from '../../../test/utils.mts'
@@ -493,13 +492,7 @@ describe('socket scan reach', async () => {
493492
const { code, stdout } = await spawnSocketCli(binCliPath, cmd, {
494493
cwd: '/tmp',
495494
})
496-
// Node 24 on Windows currently fails this test with assertion failure:
497-
// Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76
498-
const skipStdoutOnWin32Node24 =
499-
constants.WIN32 && semver.parse(constants.NODE_VERSION)!.major >= 24
500-
if (!skipStdoutOnWin32Node24) {
501-
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
502-
}
495+
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
503496
expect(code, 'should exit with code 0').toBe(0)
504497
},
505498
)

src/commands/yarn/cmd-yarn.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, expect } from 'vitest'
33
import constants from '../../../src/constants.mts'
44
import { cmdit, spawnSocketCli } from '../../../test/utils.mts'
55

6-
describe('socket yarn', async () => {
6+
describe.skipIf(constants.WIN32)('socket yarn', async () => {
77
const { binCliPath } = constants
88

99
cmdit(

0 commit comments

Comments
 (0)