@@ -38,12 +38,15 @@ function stubGetToolsInput() {
3838 return actions ;
3939}
4040
41+ const workflowLogMessage = `Using ${ InputName . Tools } input from workflow:` ;
42+
4143test ( "getToolsInput - returns workflow input if available" , async ( t ) => {
4244 const actions = stubGetToolsInput ( ) ;
4345
4446 await callee ( getToolsInput )
4547 . withActions ( actions )
4648 . withArgs ( { } )
49+ . logs ( t , workflowLogMessage )
4750 . passes ( t . deepEqual , expectedWorkflowResult ) ;
4851} ) ;
4952
@@ -57,10 +60,15 @@ test("getToolsInput - returns repository property value if enforced", async (t)
5760 } ) ;
5861
5962 // We expect the repository value if provided and the FF is enabled.
63+ const enforcedLogMessage = `Using ${ InputName . Tools } input from repository property (enforced):` ;
6064 await target
6165 . withFeatures ( [ Feature . ToolsRepositoryProperty ] )
66+ . logs ( t , enforcedLogMessage )
6267 . passes ( t . deepEqual , expectedRepositoryPropertyResult ) ;
63- await target . passes ( t . deepEqual , expectedWorkflowResult ) ;
68+ await target
69+ . notLogs ( t , enforcedLogMessage )
70+ . logs ( t , workflowLogMessage )
71+ . passes ( t . deepEqual , expectedWorkflowResult ) ;
6472} ) ;
6573
6674test ( "getToolsInput - prefers workflow input" , async ( t ) => {
@@ -75,8 +83,11 @@ test("getToolsInput - prefers workflow input", async (t) => {
7583 // We expect the workflow input regardless of the FF state.
7684 await target
7785 . withFeatures ( [ Feature . ToolsRepositoryProperty ] )
86+ . logs ( t , workflowLogMessage )
87+ . passes ( t . deepEqual , expectedWorkflowResult ) ;
88+ await target
89+ . logs ( t , workflowLogMessage )
7890 . passes ( t . deepEqual , expectedWorkflowResult ) ;
79- await target . passes ( t . deepEqual , expectedWorkflowResult ) ;
8091} ) ;
8192
8293test ( "getToolsInput - returns repository property" , async ( t ) => {
@@ -87,6 +98,7 @@ test("getToolsInput - returns repository property", async (t) => {
8798 // We expect the repository property if the FF is enabled or undefined otherwise.
8899 await target
89100 . withFeatures ( [ Feature . ToolsRepositoryProperty ] )
101+ . logs ( t , `Using ${ InputName . Tools } input from repository property:` )
90102 . passes ( t . deepEqual , expectedRepositoryPropertyResult ) ;
91103 await target . passes ( t . is , undefined ) ;
92104} ) ;
0 commit comments