File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ import * as core from '@actions/core'
12import * as github from '@actions/github'
23import { GitHub } from '@actions/github/lib/utils'
34import { run } from '../src/main'
45
6+ // Inputs for mock @actions /core
7+ let inputs = {
8+ 'configPath' : './.github/workflows'
9+ } as any
10+
511test ( 'test runs' , ( ) => {
612 // make sure to run with `INPUT_TOKEN=your-token yarn run test`
713 // Example on mocking patterns: https://github.com/actions/checkout/blob/master/__test__/input-helper.test.ts
@@ -11,6 +17,11 @@ test('test runs', () => {
1117 auth : process . env [ 'INPUT_TOKEN' ] as string
1218 } )
1319
20+ // Mock getInput
21+ jest . spyOn ( core , 'getInput' ) . mockImplementation ( ( name : string ) => {
22+ return inputs [ name ]
23+ } )
24+
1425 // Mock github context
1526 jest . spyOn ( github . context , 'issue' , 'get' ) . mockImplementation ( ( ) => {
1627 return {
You can’t perform that action at this time.
0 commit comments