Skip to content

Commit bd337b8

Browse files
committed
chore: fix CI which has been broken since v2 release
1 parent d356e68 commit bd337b8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

__tests__/main.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
import * as core from '@actions/core'
12
import * as github from '@actions/github'
23
import {GitHub} from '@actions/github/lib/utils'
34
import {run} from '../src/main'
45

6+
// Inputs for mock @actions/core
7+
let inputs = {
8+
'configPath': './.github/workflows'
9+
} as any
10+
511
test('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 {

0 commit comments

Comments
 (0)