Skip to content

Commit 8aa0304

Browse files
committed
Redact version numbers for cdxgen snapshots
1 parent 53a83c9 commit 8aa0304

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ describe('socket manifest cdxgen', async () => {
1515
// Need to pass it on as env because --config will break cdxgen
1616
SOCKET_CLI_CONFIG: '{}',
1717
})
18-
expect(stdout).toMatchInlineSnapshot(
18+
19+
const redactedStdout = stdout
20+
.replace(/(?<=CycloneDX\s+Generator\s+)[\d.]+/, '<redacted>')
21+
.replace(/(?<=Node\.js,\s+Version:\s+)[\d.]+/, '<redacted>')
22+
23+
expect(redactedStdout).toMatchInlineSnapshot(
1924
`
20-
"CycloneDX Generator 11.5.0
21-
Runtime: Node.js, Version: 24.5.0"
25+
"CycloneDX Generator <redacted>
26+
Runtime: Node.js, Version: <redacted>"
2227
`,
2328
)
2429
expect(`\n ${stderr}`).toMatchInlineSnapshot(`

0 commit comments

Comments
 (0)