Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner,docs: align documentation with actual stdout/stderr behavior #53131

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -2862,11 +2862,7 @@ The corresponding execution ordered event is `'test:dequeue'`.
### Event: `'test:stderr'`

* `data` {Object}
* `column` {number|undefined} The column number where the test is defined, or
`undefined` if the test was run through the REPL.
* `file` {string} The path of the test file.
* `line` {number|undefined} The line number where the test is defined, or
`undefined` if the test was run through the REPL.
* `message` {string} The message written to `stderr`.

Emitted when a running test writes to `stderr`.
Expand All @@ -2877,11 +2873,7 @@ defined.
### Event: `'test:stdout'`

* `data` {Object}
* `column` {number|undefined} The column number where the test is defined, or
`undefined` if the test was run through the REPL.
* `file` {string} The path of the test file.
* `line` {number|undefined} The line number where the test is defined, or
`undefined` if the test was run through the REPL.
* `message` {string} The message written to `stdout`.

Emitted when a running test writes to `stdout`.
Expand Down
8 changes: 0 additions & 8 deletions lib/internal/test_runner/tests_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ class TestsStream extends Readable {
});
}

stderr(loc, message) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was unused. actual events are emitted here (using kEmitMessage directly):

subtest.addToReport({
__proto__: null,
type: 'test:stderr',
data: { __proto__: null, file: path, message: line + '\n' },
});

this[kEmitMessage]('test:stderr', { __proto__: null, message, ...loc });
}

stdout(loc, message) {
this[kEmitMessage]('test:stdout', { __proto__: null, message, ...loc });
}

coverage(nesting, loc, summary) {
this[kEmitMessage]('test:coverage', {
__proto__: null,
Expand Down