Jonathan Clem cca9523c73
Add the "@actions/exit" package
It is useful to have the exit logic separated into its own package
2019-04-20 10:52:56 -04:00

20 lines
490 B
TypeScript

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