File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,26 @@ const mockOctokit = {
4444
4545describe ( "API" , ( ) => {
4646 beforeEach ( ( ) => {
47- jest . spyOn ( core , "getInput" ) . mockReturnValue ( "" ) ;
47+ jest . spyOn ( core , "getInput" ) . mockImplementation ( ( key : string ) => {
48+ switch ( key ) {
49+ case "token" :
50+ return "token" ;
51+ case "ref" :
52+ return "ref" ;
53+ case "repo" :
54+ return "repo" ;
55+ case "owner" :
56+ return "owner" ;
57+ case "workflow" :
58+ return "workflow" ;
59+ case "workflow_inputs" :
60+ return JSON . stringify ( { testInput : "test" } ) ;
61+ case "workflow_timeout_seconds" :
62+ return "30" ;
63+ default :
64+ return "" ;
65+ }
66+ } ) ;
4867 jest . spyOn ( github , "getOctokit" ) . mockReturnValue ( mockOctokit as any ) ;
4968 init ( ) ;
5069 } ) ;
@@ -172,7 +191,7 @@ describe("API", () => {
172191 repo : "repository" ,
173192 owner : "owner" ,
174193 workflow : "workflow_name" ,
175- workflowInputs : { } ,
194+ workflowInputs : { testInput : "test" } ,
176195 workflowTimeoutSeconds : 60 ,
177196 } ;
178197
You can’t perform that action at this time.
0 commit comments