bdb27c47d0
Signed-off-by: Meredith Lancaster <malancas@github.com>
29 lines
622 B
TypeScript
29 lines
622 B
TypeScript
/**
|
|
* Unit tests for the action's entrypoint, src/index.ts
|
|
*/
|
|
|
|
import { jest, describe, expect, beforeEach } from '@jest/globals'
|
|
|
|
// Mock modules before importing them
|
|
const runMock = jest.fn<() => Promise<void>>()
|
|
|
|
jest.unstable_mockModule('../src/main', () => ({
|
|
run: runMock
|
|
}))
|
|
|
|
jest.unstable_mockModule('@actions/core', () => ({
|
|
getInput: jest.fn(() => ''),
|
|
getBooleanInput: jest.fn(() => false)
|
|
}))
|
|
|
|
describe('index', () => {
|
|
beforeEach(() => {
|
|
jest.clearAllMocks()
|
|
})
|
|
it('calls run when imported', async () => {
|
|
await import('../src/index.js')
|
|
|
|
expect(runMock).toHaveBeenCalled()
|
|
})
|
|
})
|