Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup!: try awaiting subtests
  • Loading branch information
JakobJingleheimer committed Mar 15, 2026
commit d5e777d6c7ff623db15d18a831ec52ee240f5fb2
26 changes: 14 additions & 12 deletions test/parallel/test-runner-subtest-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ test('subtest should return a promise', async (t) => {
});

test('t.test[variant]() should return a promise', async (t) => {
assert.ok(isPromise(
t.test.expectFailure('expectFailure subtest', () => { throw new Error('This should pass'); })
));
assert.ok(isPromise(
t.test.only('only subtest')
));
assert.ok(isPromise(
t.test.skip('skip subtest')
));
assert.ok(isPromise(
t.test.todo('todo subtest')
));
const xfail = t.test.expectFailure('expectFailure subtest', () => { throw new Error('This should pass'); });
const only = t.test.only('only subtest');
const skip = t.test.skip('skip subtest');
const todo = t.test.todo('todo subtest');

assert.ok(isPromise(xfail));
assert.ok(isPromise(only));
assert.ok(isPromise(skip));
assert.ok(isPromise(todo));

await xfail;
await only;
await skip;
await todo;
});

test('nested subtests should have test variants', async (t) => {
Expand Down
Loading