@@ -11,6 +11,9 @@ import {listChangesForCodyResponse} from "./utils/fs-tree";
1111
1212const modeKey = "mode" ;
1313const modeValueTest = "test-scenario" ;
14+ const givenKey = "given" ;
15+ const whenKey = "when" ;
16+ const thenKey = "then" ;
1417
1518export const onFeature : CodyHook < Context > = async ( feature : Node , ctx : Context ) => {
1619 try {
@@ -64,7 +67,7 @@ export const onFeature: CodyHook<Context> = async (feature: Node, ctx: Context)
6467 }
6568 }
6669
67- const changesForCodyResponse = await createTestFiles ( feature . getName ( ) , givenNodes , whenCommand , thenNodes , ctx ) ;
70+ const changesForCodyResponse = await createTestFiles ( feature . getName ( ) , featureMeta , givenNodes , whenCommand , thenNodes , ctx ) ;
6871
6972 // for logging:
7073 const loggedNodes : Array < string > = [ ] ;
@@ -99,7 +102,7 @@ export const onFeature: CodyHook<Context> = async (feature: Node, ctx: Context)
99102 }
100103}
101104
102- async function createTestFiles ( featureName : string , givenNodes : Array < Node > , whenCommand : Node , thenNodes : Array < Node > , ctx : Context ) : Promise < string > {
105+ async function createTestFiles ( featureName : string , featureMeta : any , givenNodes : Array < Node > , whenCommand : Node , thenNodes : Array < Node > , ctx : Context ) : Promise < string > {
103106 // if using a service from another board (e.g. Fleet Management), make sure to set this up in the test feature's metadata!
104107 const service = withErrorCheck ( detectService , [ whenCommand , ctx ] ) ;
105108
@@ -111,6 +114,9 @@ async function createTestFiles(featureName: string, givenNodes : Array<Node>, wh
111114 "feature" : names ( featureName ) . className ,
112115 "serviceNames" : names ( service ) ,
113116 "featureNames" : names ( featureName ) ,
117+ "given" : featureMeta [ givenKey ] ,
118+ "when" : featureMeta [ whenKey ] ,
119+ "then" : featureMeta [ thenKey ] ,
114120 "givenEvent" : names ( givenNodes [ 0 ] . getName ( ) ) ,
115121 "whenEvent" : names ( whenCommand . getName ( ) ) ,
116122 "thenEvent" : names ( thenNodes [ 0 ] . getName ( ) ) ,
0 commit comments