Skip to content

Commit

Permalink
Sanitize timers.js positions in reporter logs
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Sep 8, 2020
1 parent db5d2c3 commit f42e0e0
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions test-tap/helper/report.js
Expand Up @@ -61,6 +61,7 @@ exports.sanitizers = {
experimentalWarning: string => string.replace(/^\(node:\d+\) ExperimentalWarning.+\n/g, ''),
lineEndings: string => replaceString(string, '\r\n', '\n'),
posix: string => replaceString(string, '\\', '/'),
timers: string => string.replace(/timers\.js:\d+:\d+/g, 'timers.js'),
version: string => replaceString(string, `v${pkg.version}`, 'v1.0.0-beta.5.1')
};

Expand Down
2 changes: 1 addition & 1 deletion test-tap/reporters/mini.js
Expand Up @@ -19,7 +19,7 @@ const run = (type, sanitizers = []) => t => {

const tty = new TTYStream({
columns: 200,
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.version]
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.timers, report.sanitizers.version]
});
const reporter = new Reporter({
projectDir: report.projectDir(type),
Expand Down
4 changes: 2 additions & 2 deletions test-tap/reporters/mini.regular.v12.log
Expand Up @@ -504,8 +504,8 @@
Error: Can’t catch me

› Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9)
› listOnTimeout (internal/timers.js:549:17)
› processTimers (internal/timers.js:492:7)
› listOnTimeout (internal/timers.js)
› processTimers (internal/timers.js)



Expand Down
4 changes: 2 additions & 2 deletions test-tap/reporters/mini.regular.v14.log
Expand Up @@ -504,8 +504,8 @@
Error: Can’t catch me

› Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9)
› listOnTimeout (internal/timers.js:551:17)
› processTimers (internal/timers.js:494:7)
› listOnTimeout (internal/timers.js)
› processTimers (internal/timers.js)



Expand Down
2 changes: 1 addition & 1 deletion test-tap/reporters/tap.js
Expand Up @@ -14,7 +14,7 @@ const run = (type, sanitizers = []) => t => {

const tty = new TTYStream({
columns: 200,
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix]
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.timers]
});
const reporter = new TapReporter({
projectDir: report.projectDir(type),
Expand Down
4 changes: 2 additions & 2 deletions test-tap/reporters/tap.regular.v12.log
Expand Up @@ -298,8 +298,8 @@ not ok 25 - Error: Can’t catch me
message: Can’t catch me
at: |-
Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9)
listOnTimeout (internal/timers.js:549:17)
processTimers (internal/timers.js:492:7)
listOnTimeout (internal/timers.js)
processTimers (internal/timers.js)
...
---tty-stream-chunk-separator
# uncaught-exception.js exited with a non-zero exit code: 1
Expand Down
4 changes: 2 additions & 2 deletions test-tap/reporters/tap.regular.v14.log
Expand Up @@ -298,8 +298,8 @@ not ok 25 - Error: Can’t catch me
message: Can’t catch me
at: |-
Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9)
listOnTimeout (internal/timers.js:551:17)
processTimers (internal/timers.js:494:7)
listOnTimeout (internal/timers.js)
processTimers (internal/timers.js)
...
---tty-stream-chunk-separator
# uncaught-exception.js exited with a non-zero exit code: 1
Expand Down
2 changes: 1 addition & 1 deletion test-tap/reporters/verbose.js
Expand Up @@ -13,7 +13,7 @@ const run = (type, sanitizers = []) => t => {

const tty = new TTYStream({
columns: 200,
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.version]
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.timers, report.sanitizers.version]
});
const reporter = new Reporter({
projectDir: report.projectDir(type),
Expand Down
4 changes: 2 additions & 2 deletions test-tap/reporters/verbose.regular.v12.log
Expand Up @@ -94,8 +94,8 @@
Error: Can’t catch me

› Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9)
› listOnTimeout (internal/timers.js:549:17)
› processTimers (internal/timers.js:492:7)
› listOnTimeout (internal/timers.js)
› processTimers (internal/timers.js)

---tty-stream-chunk-separator
✖ uncaught-exception.js exited with a non-zero exit code: 1
Expand Down
4 changes: 2 additions & 2 deletions test-tap/reporters/verbose.regular.v14.log
Expand Up @@ -94,8 +94,8 @@
Error: Can’t catch me

› Timeout._onTimeout (test-tap/fixture/report/regular/uncaught-exception.js:5:9)
› listOnTimeout (internal/timers.js:551:17)
› processTimers (internal/timers.js:494:7)
› listOnTimeout (internal/timers.js)
› processTimers (internal/timers.js)

---tty-stream-chunk-separator
✖ uncaught-exception.js exited with a non-zero exit code: 1
Expand Down

0 comments on commit f42e0e0

Please sign in to comment.