Skip to content

Commit d5e777d

Browse files
fixup!: try awaiting subtests
1 parent e611323 commit d5e777d

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

test/parallel/test-runner-subtest-methods.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ test('subtest should return a promise', async (t) => {
2020
});
2121

2222
test('t.test[variant]() should return a promise', async (t) => {
23-
assert.ok(isPromise(
24-
t.test.expectFailure('expectFailure subtest', () => { throw new Error('This should pass'); })
25-
));
26-
assert.ok(isPromise(
27-
t.test.only('only subtest')
28-
));
29-
assert.ok(isPromise(
30-
t.test.skip('skip subtest')
31-
));
32-
assert.ok(isPromise(
33-
t.test.todo('todo subtest')
34-
));
23+
const xfail = t.test.expectFailure('expectFailure subtest', () => { throw new Error('This should pass'); });
24+
const only = t.test.only('only subtest');
25+
const skip = t.test.skip('skip subtest');
26+
const todo = t.test.todo('todo subtest');
27+
28+
assert.ok(isPromise(xfail));
29+
assert.ok(isPromise(only));
30+
assert.ok(isPromise(skip));
31+
assert.ok(isPromise(todo));
32+
33+
await xfail;
34+
await only;
35+
await skip;
36+
await todo;
3537
});
3638

3739
test('nested subtests should have test variants', async (t) => {

0 commit comments

Comments
 (0)