Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 3 additions & 1 deletion lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,10 @@ class Suite extends Test {

try {
const { ctx, args } = this.getRunArgs();
const runArgs = ArrayPrototypeSlice(args);
ArrayPrototypeShift(runArgs, ctx);
Comment thread
benjamingr marked this conversation as resolved.
Resolved
this.buildSuite = PromisePrototypeThen(
PromiseResolve(this.runInAsyncScope(this.fn, ctx, args)),
PromiseResolve(ReflectApply(this.runInAsyncScope, this.fn, runArgs)),
Comment thread
MoLow marked this conversation as resolved.
Resolved
undefined,
(err) => {
this.fail(new ERR_TEST_FAILURE(err, kTestCodeFailure));
Expand Down
8 changes: 8 additions & 0 deletions test/parallel/test-runner-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ if (process.argv[2] === 'child') {
})).finally(common.mustCall(() => {
test(() => assert.strictEqual(testSignal.aborted, true));
}));

// TODO(benjamingr) add more tests to describe + AbortSignal
// this just tests the parameter is passed
test.describe('Abort Signal in describe', common.mustCall(({ signal }) => {
test.it('Supports AbortSignal', () => {
assert.strictEqual(signal.aborted, false);
});
}));
} else assert.fail('unreachable');
} else {
const child = spawnSync(process.execPath, [__filename, 'child', 'abortSignal']);
Expand Down