Skip to content

Commit bf92eb4

Browse files
committed
Fix tests in ci
1 parent 377bf1d commit bf92eb4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/utils.mts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { fileURLToPath } from 'node:url'
44
import { it } from 'vitest'
55

66
import { spawn } from '@socketsecurity/registry/lib/spawn'
7+
import { stripAnsi } from '@socketsecurity/registry/lib/strings'
78

89
import constants from '../src/constants.mts'
910

@@ -63,15 +64,15 @@ export async function invokeNpm(
6364
return {
6465
status: true,
6566
code: 0,
66-
stdout: toAsciiSafeString(normalizeLogSymbols(output.stdout.trim())),
67-
stderr: toAsciiSafeString(normalizeLogSymbols(output.stderr.trim())),
67+
stdout: toAsciiSafeString(normalizeLogSymbols(stripAnsi(output.stdout.trim()))),
68+
stderr: toAsciiSafeString(normalizeLogSymbols(stripAnsi(output.stderr.trim()))),
6869
}
6970
} catch (e: unknown) {
7071
return {
7172
status: false,
7273
code: e?.['code'],
73-
stdout: toAsciiSafeString(normalizeLogSymbols(e?.['stdout'] ?? '')),
74-
stderr: toAsciiSafeString(normalizeLogSymbols(e?.['stderr'] ?? '')),
74+
stdout: toAsciiSafeString(normalizeLogSymbols(stripAnsi(e?.['stdout']?.trim() ?? ''))),
75+
stderr: toAsciiSafeString(normalizeLogSymbols(stripAnsi(e?.['stderr']?.trim() ?? ''))),
7576
}
7677
}
7778
}

0 commit comments

Comments
 (0)