Skip to content

Commit 81ea49b

Browse files
author
Michael Stramel
committed
strip ansi-escapes
1 parent 7c40765 commit 81ea49b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/integration/runner.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ function stripConfigErrorPath(stdout) {
4040
function stripResolveErrorPath(stdout) {
4141
return stdout.replace(/" via "(.*)"/g, '" via "XXX"');
4242
}
43+
function stripAnsiEscapes(stdout) {
44+
return stdout.replace(/[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-ntqry=><~]))/g, '');
45+
}
4346

4447
function removeLockfile(testName) {
4548
const lockfileLoc = path.join(__dirname, testName, 'snowpack.lock.json');
@@ -84,7 +87,7 @@ for (const testName of readdirSync(__dirname)) {
8487
assert.strictEqual(
8588
stripWhitespace(
8689
stripConfigErrorPath(
87-
stripResolveErrorPath(stripBenchmark(stripChunkHash(stripStats(all)))),
90+
stripResolveErrorPath(stripBenchmark(stripChunkHash(stripStats(stripAnsiEscapes(all))))),
8891
),
8992
),
9093
stripWhitespace(expectedOutput),

0 commit comments

Comments
 (0)