Skip to content

Commit

Permalink
test_runner: add level parameter to reporter.diagnostic
Browse files Browse the repository at this point in the history
Added a parameter to allow severity-based formatting for
diagnostic messages. Defaults to 'info'.
This update enables better control over message presentation
(e.g., coloring) based on severity levels such as 'info', 'warn',
and 'error'.

Refs: nodejs#55922
  • Loading branch information
hpatel292-seneca committed Nov 23, 2024
1 parent e92499c commit 7dda539
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/test_runner/tests_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ class TestsStream extends Readable {
});
}

diagnostic(nesting, loc, message) {
diagnostic(nesting, loc, message, level = 'info') {
this[kEmitMessage]('test:diagnostic', {
__proto__: null,
nesting,
message,
level,
...loc,
});
}
Expand Down

0 comments on commit 7dda539

Please sign in to comment.