Skip to content

Commit

Permalink
chore: fix CI which has been broken since v2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
myyk committed Oct 16, 2023
1 parent d356e68 commit bd337b8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import * as core from '@actions/core'
import * as github from '@actions/github'
import {GitHub} from '@actions/github/lib/utils'
import {run} from '../src/main'

// Inputs for mock @actions/core
let inputs = {
'configPath': './.github/workflows'
} as any

test('test runs', () => {
// make sure to run with `INPUT_TOKEN=your-token yarn run test`
// Example on mocking patterns: https://github.com/actions/checkout/blob/master/__test__/input-helper.test.ts
Expand All @@ -11,6 +17,11 @@ test('test runs', () => {
auth: process.env['INPUT_TOKEN'] as string
})

// Mock getInput
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
return inputs[name]
})

// Mock github context
jest.spyOn(github.context, 'issue', 'get').mockImplementation(() => {
return {
Expand Down

0 comments on commit bd337b8

Please sign in to comment.