Skip to content

Commit

Permalink
test_runner: pass noop fn when test marked as todo
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkit-30 committed Jan 10, 2024
1 parent e0b159e commit 0684d04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class Test extends AsyncResource {
skip = '\'only\' option not set';
}

if (skip) {
if (skip || todo) {
fn = noop;
}

Expand Down
28 changes: 2 additions & 26 deletions test/fixtures/test-runner/output/describe_it.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,14 @@ ok 2 - sync pass todo with message # TODO this is a passing todo
duration_ms: *
...
# Subtest: sync todo
not ok 3 - sync todo # TODO
ok 3 - sync todo # TODO
---
duration_ms: *
location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):4'
failureType: 'testCodeFailure'
error: 'should not count as a failure'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
...
# Subtest: sync todo with message
not ok 4 - sync todo with message # TODO this is a failing todo
ok 4 - sync todo with message # TODO this is a failing todo
---
duration_ms: *
location: '/test/fixtures/test-runner/output/describe_it.js:(LINE):1'
failureType: 'testCodeFailure'
error: 'should not count as a failure'
code: 'ERR_TEST_FAILURE'
stack: |-
*
*
*
*
*
*
*
...
# Subtest: sync skip pass
ok 5 - sync skip pass # SKIP
Expand Down

0 comments on commit 0684d04

Please sign in to comment.