Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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: 7 additions & 1 deletion lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const {
SafeMap,
SafeSet,
StringPrototypeStartsWith,
StringPrototypeSplit,
Comment thread
aduh95 marked this conversation as resolved.
Outdated
} = primordials;

const { spawn } = require('child_process');
Expand Down Expand Up @@ -51,6 +52,7 @@ const {

const kFilterArgs = ['--test', '--experimental-test-coverage', '--watch'];
const kFilterArgValues = ['--test-reporter', '--test-reporter-destination'];
const diagnosticsFilterArgs = ['tests', 'pass', 'fail', 'cancelled', 'skipped', 'todo', 'duration_ms'];
Comment thread
aduh95 marked this conversation as resolved.
Outdated

// TODO(cjihrig): Replace this with recursive readdir once it lands.
function processPath(path, testFiles, options) {
Expand Down Expand Up @@ -130,6 +132,10 @@ function getRunArgs({ path, inspectPort }) {

class FileTest extends Test {
#buffer = [];
#checkNestedComment(node) {
const commentArgs = StringPrototypeSplit(node.comment, ' ');
Comment thread
aduh95 marked this conversation as resolved.
Outdated
return commentArgs.length === 2 && ArrayPrototypeIncludes(diagnosticsFilterArgs, commentArgs[0]);
}
#handleReportItem({ kind, node, nesting = 0 }) {
nesting += 1;

Expand Down Expand Up @@ -183,7 +189,7 @@ class FileTest extends Test {
break;

case TokenKind.COMMENT:
if (nesting === 1) {
if (nesting === 1 && this.#checkNestedComment(node)) {
// Ignore file top level diagnostics
break;
}
Expand Down
6 changes: 6 additions & 0 deletions test/message/test_runner_output_cli.out
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,12 @@ TAP version 13
*
...
1..65
# Warning: Test "unhandled rejection - passes but warns" generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event.
# Warning: Test "async unhandled rejection - passes but warns" generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event.
# Warning: Test "immediate throw - passes but warns" generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event.
# Warning: Test "immediate reject - passes but warns" generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event.
# Warning: Test "callback called twice in different ticks" generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event.
# Warning: Test "callback async throw after done" generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event.
not ok 1 - *test_runner_output.js
---
duration_ms: *
Expand Down
4 changes: 2 additions & 2 deletions test/message/test_runner_output_spec_reporter.out
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@

async assertion fail (*ms)
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

true !== false

*
*
*
Expand Down