-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_runner: don't parse TAP from stderr
This commit stops the test runner CLI from parsing child process stderr as TAP. Per the TAP spec, TAP can only come from stdout. To avoid losing stderr data, those logs are injected into the parser as unknown tokens so that they are output as comments. PR-URL: #45618 Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
- Loading branch information
Showing
4 changed files
with
67 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
const test = require('node:test'); | ||
|
||
console.error('stderr', 1); | ||
|
||
test('a test', async () => { | ||
console.error('stderr', 2); | ||
await new Promise((resolve) => { | ||
console.log('stdout', 3); | ||
setTimeout(() => { | ||
// This should not be sent to the TAP parser. | ||
console.error('not ok 1 - fake test'); | ||
resolve(); | ||
console.log('stdout', 4); | ||
}, 2); | ||
}); | ||
console.error('stderr', 5); | ||
}); | ||
|
||
console.error('stderr', 6); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters