Add the "@actions/exit" package
It is useful to have the exit logic separated into its own package
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import * as exit from '../src/exit'
|
||||
|
||||
it('exits successfully', () => {
|
||||
jest.spyOn(process, 'exit').mockImplementation()
|
||||
exit.success()
|
||||
expect(process.exit).toHaveBeenCalledWith(0)
|
||||
})
|
||||
|
||||
it('exits as a failure', () => {
|
||||
jest.spyOn(process, 'exit').mockImplementation()
|
||||
exit.failure()
|
||||
expect(process.exit).toHaveBeenCalledWith(1)
|
||||
})
|
||||
|
||||
it('exits neutrally', () => {
|
||||
jest.spyOn(process, 'exit').mockImplementation()
|
||||
exit.neutral()
|
||||
expect(process.exit).toHaveBeenCalledWith(78)
|
||||
})
|
||||
Reference in New Issue
Block a user