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'
1
2
import * as github from '@actions/github'
2
3
import { GitHub } from '@actions/github/lib/utils'
3
4
import { run } from '../src/main'
4
5
6
+ // Inputs for mock @actions /core
7
+ let inputs = {
8
+ 'configPath' : './.github/workflows'
9
+ } as any
10
+
5
11
test ( 'test runs' , ( ) => {
6
12
// make sure to run with `INPUT_TOKEN=your-token yarn run test`
7
13
// Example on mocking patterns: https://github.com/actions/checkout/blob/master/__test__/input-helper.test.ts
@@ -11,6 +17,11 @@ test('test runs', () => {
11
17
auth : process . env [ 'INPUT_TOKEN' ] as string
12
18
} )
13
19
20
+ // Mock getInput
21
+ jest . spyOn ( core , 'getInput' ) . mockImplementation ( ( name : string ) => {
22
+ return inputs [ name ]
23
+ } )
24
+
14
25
// Mock github context
15
26
jest . spyOn ( github . context , 'issue' , 'get' ) . mockImplementation ( ( ) => {
16
27
return {
You can’t perform that action at this time.
0 commit comments