Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: add SuiteContext class #45687

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 18 additions & 1 deletion lib/internal/test_runner/test.js
Expand Up @@ -146,6 +146,22 @@ class TestContext {
}
}

class SuiteContext {
#suite;

constructor(suite) {
this.#suite = suite;
}

get signal() {
return this.#suite.signal;
}

get name() {
return this.#suite.name;
}
}

class Test extends AsyncResource {
#abortController;
#outerSignal;
Expand Down Expand Up @@ -737,7 +753,8 @@ class Suite extends Test {
}

getRunArgs() {
return { ctx: { signal: this.signal, name: this.name }, args: [] };
const ctx = new SuiteContext(this);
return { ctx, args: [ctx] };
}

async run() {
Expand Down