@@ -19,7 +19,7 @@ export function createRunner({ workerState }: { workerState: WorkerState }): {
1919 hooks : RunnerHooks ,
2020 api : Rstest ,
2121 ) => Promise < TestFileResult > ;
22- collectTests : ( ) => Promise < Test [ ] > ;
22+ collectTests : ( ) => Promise < TestInfo [ ] > ;
2323 getCurrentTest : TestRunner [ 'getCurrentTest' ] ;
2424 } ;
2525} {
@@ -55,18 +55,7 @@ export function createRunner({ workerState }: { workerState: WorkerState }): {
5555 traverseUpdateTest ( tests , testNamePattern ) ;
5656 hooks . onTestFileReady ?.( {
5757 testPath,
58- tests : tests . map ( function toTestInfo ( test : Test ) : TestInfo {
59- return {
60- testId : test . testId ,
61- name : test . name ,
62- parentNames : test . parentNames ,
63- testPath : test . testPath ,
64- project : test . project ,
65- type : test . type ,
66- location : test . location ,
67- tests : test . type === 'suite' ? test . tests . map ( toTestInfo ) : [ ] ,
68- } ;
69- } ) ,
58+ tests : tests . map ( toTestInfo ) ,
7059 } ) ;
7160 runtime . instance . updateStatus ( 'running' ) ;
7261
@@ -85,9 +74,23 @@ export function createRunner({ workerState }: { workerState: WorkerState }): {
8574 const tests = await runtime . instance . getTests ( ) ;
8675 traverseUpdateTest ( tests , testNamePattern ) ;
8776
88- return tests ;
77+ return tests . map ( toTestInfo ) ;
8978 } ,
9079 getCurrentTest : ( ) => testRunner . getCurrentTest ( ) ,
9180 } ,
9281 } ;
9382}
83+
84+ function toTestInfo ( test : Test ) : TestInfo {
85+ return {
86+ testId : test . testId ,
87+ name : test . name ,
88+ parentNames : test . parentNames ,
89+ testPath : test . testPath ,
90+ project : test . project ,
91+ type : test . type ,
92+ location : test . location ,
93+ tests : test . type === 'suite' ? test . tests . map ( toTestInfo ) : [ ] ,
94+ runMode : test . runMode ,
95+ } ;
96+ }
0 commit comments