Skip to content
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
2 changes: 1 addition & 1 deletion lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ class Test extends AsyncResource {
this.expectedAssertions = plan;
this.cancelled = false;
this.skipped = skip !== undefined && skip !== false;
this.isTodo = todo !== undefined && todo !== false;
this.isTodo = (todo !== undefined && todo !== false) || this.parent?.isTodo;
this.startTime = null;
this.endTime = null;
this.passed = false;
Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/test-runner/output/name_pattern.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,20 @@ ok 9 - no
...
# Subtest: no with todo
# Subtest: yes
ok 1 - yes
ok 1 - yes # TODO
---
duration_ms: *
type: 'test'
...
# Subtest: maybe
# Subtest: yes
ok 1 - yes
ok 1 - yes # TODO
---
duration_ms: *
type: 'test'
...
1..1
ok 2 - maybe
ok 2 - maybe # TODO
---
duration_ms: *
type: 'suite'
Expand Down Expand Up @@ -193,9 +193,9 @@ ok 11 - DescribeForMatchWithAncestors
1..11
# tests 18
# suites 12
# pass 16
# pass 14
# fail 0
# cancelled 0
# skipped 2
# todo 0
# todo 2
# duration_ms *
6 changes: 6 additions & 0 deletions test/fixtures/test-runner/todo_exit_code.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ test.todo('should fail without effecting exit code', () => {
test('empty string todo', { todo: '' }, () => {
throw new Error('Fail but not badly')
});

describe.todo('should inherit todo', () => {
test('should fail without harming suite', () => {
throw new Error('Fail but not badly');
});
});
4 changes: 2 additions & 2 deletions test/parallel/test-runner-exit-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ if (process.argv[2] === 'child') {
assert.strictEqual(child.status, 0);
assert.strictEqual(child.signal, null);
const stdout = child.stdout.toString();
assert.match(stdout, /tests 3/);
assert.match(stdout, /tests 4/);
assert.match(stdout, /pass 0/);
assert.match(stdout, /fail 0/);
assert.match(stdout, /todo 3/);
assert.match(stdout, /todo 4/);

child = spawnSync(process.execPath, [__filename, 'child', 'fail']);
assert.strictEqual(child.status, 1);
Expand Down
Loading