typescript-action/__tests__/index.test.ts

18 lines
414 B
TypeScript
Raw Permalink Normal View History

2023-08-24 17:26:10 +00:00
/**
* Unit tests for the action's entrypoint, src/index.ts
*/
2023-08-23 17:39:12 +00:00
import * as main from '../src/main'
2023-08-24 17:26:10 +00:00
// Mock the action's entrypoint
const runMock = jest.spyOn(main, 'run').mockImplementation()
2023-08-24 17:26:10 +00:00
describe('index', () => {
it('calls run when imported', async () => {
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../src/index')
2023-08-23 17:39:12 +00:00
expect(runMock).toHaveBeenCalled()
2023-08-24 17:26:10 +00:00
})
2023-08-23 17:39:12 +00:00
})