mirror of
https://github.com/actions/javascript-action.git
synced 2025-12-12 14:17:37 +00:00
Restructure source and tests
This commit is contained in:
18
__tests__/index.test.js
Normal file
18
__tests__/index.test.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Unit tests for the action's entrypoint, src/index.ts
|
||||
*/
|
||||
|
||||
const { run } = require('../src/main')
|
||||
|
||||
// Mock the action's entrypoint
|
||||
jest.mock('../src/main', () => ({
|
||||
run: jest.fn()
|
||||
}))
|
||||
|
||||
describe('index', () => {
|
||||
it('calls run when imported', async () => {
|
||||
require('../src/index')
|
||||
|
||||
expect(run).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user