2019-04-20 14:52:56 +00:00
|
|
|
import * as exit from '../src/exit'
|
|
|
|
|
2019-05-21 21:08:25 +00:00
|
|
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
|
|
|
2019-04-20 14:52:56 +00:00
|
|
|
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)
|
|
|
|
})
|