Skip to content

Commit 99410ef

Browse files
debadree25targos
authored andcommitted
lib: added SuiteContext class
added SuiteContext class to replace object literal Fixes: #45641 Refs: #45641 (comment) PR-URL: #45687 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 3e48536 commit 99410ef

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

lib/internal/test_runner/test.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,22 @@ class TestContext {
146146
}
147147
}
148148

149+
class SuiteContext {
150+
#suite;
151+
152+
constructor(suite) {
153+
this.#suite = suite;
154+
}
155+
156+
get signal() {
157+
return this.#suite.signal;
158+
}
159+
160+
get name() {
161+
return this.#suite.name;
162+
}
163+
}
164+
149165
class Test extends AsyncResource {
150166
#abortController;
151167
#outerSignal;
@@ -737,7 +753,8 @@ class Suite extends Test {
737753
}
738754

739755
getRunArgs() {
740-
return { ctx: { signal: this.signal, name: this.name }, args: [] };
756+
const ctx = new SuiteContext(this);
757+
return { ctx, args: [ctx] };
741758
}
742759

743760
async run() {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy