@@ -5,6 +5,8 @@ import { currentGroupOptions, registerTest, setCurrentGroup } from '@/worker/loc
55
66const workerData = getTestWorkerData ( ) ;
77
8+ const testPromptStack : Record < string , string [ ] > = { } ;
9+
810function testDecl (
911 title : string ,
1012 optionsOrTestFn : TestOptions | TestFunction ,
@@ -25,7 +27,7 @@ function testDecl(
2527 testFn = testFnOrNothing ;
2628 }
2729
28- const groupOptions = currentGroupOptions ( ) ;
30+ const groupOptions = currentGroupOptions ( ) ;
2931
3032 const combinedOptions : TestOptions = {
3133 ...( workerData . options ?? { } ) ,
@@ -38,6 +40,12 @@ function testDecl(
3840 throw Error ( "URL must be provided either through (1) env var MAGNITUDE_TEST_URL, (2) via magnitude.config.ts, or (3) in group or test options" ) ;
3941 }
4042
43+ // Stack group and test prompts (group first, then test)
44+ const promptStack : string [ ] = [ ] ;
45+ if ( groupOptions . prompt ) promptStack . push ( groupOptions . prompt ) ;
46+ if ( options . prompt ) promptStack . push ( options . prompt ) ;
47+ testPromptStack [ title ] = promptStack ;
48+
4149 registerTest ( testFn , title , addProtocolIfMissing ( combinedOptions . url ) ) ;
4250
4351 // TODO: maybe return an object to enable some kind of chaining
@@ -69,3 +77,5 @@ testDecl.group = function (
6977}
7078
7179export const test = testDecl as TestDeclaration ;
80+
81+ export { testPromptStack } ;
0 commit comments