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

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

‎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+
classSuiteContext{
150+
#suite;
151+
152+
constructor(suite){
153+
this.#suite =suite;
154+
}
155+
156+
getsignal(){
157+
returnthis.#suite.signal;
158+
}
159+
160+
getname(){
161+
returnthis.#suite.name;
162+
}
163+
}
164+
149165
classTestextendsAsyncResource{
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+
constctx=newSuiteContext(this);
757+
return{ ctx,args: [ctx]};
741758
}
742759

743760
asyncrun(){

0 commit comments

Comments
 (0)