Files
attest/__tests__/index.test.ts
T
Meredith Lancaster bdb27c47d0 tests handle esm
Signed-off-by: Meredith Lancaster <malancas@github.com>
2026-02-05 13:09:33 -08:00

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()
})
})