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
|
|
|
|
2023-09-11 19:54:30 +00:00
|
|
|
import * as main from '../src/main'
|
2023-08-24 17:26:10 +00:00
|
|
|
|
|
|
|
// Mock the action's entrypoint
|
2023-09-11 19:54:30 +00:00
|
|
|
const runMock = jest.spyOn(main, 'run').mockImplementation()
|
2023-08-24 17:26:10 +00:00
|
|
|
|
2023-09-11 19:54:30 +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
|
|
|
|
2023-09-11 19:54:30 +00:00
|
|
|
expect(runMock).toHaveBeenCalled()
|
2023-08-24 17:26:10 +00:00
|
|
|
})
|
2023-08-23 17:39:12 +00:00
|
|
|
})
|