mirror of https://github.com/actions/toolkit
22 lines
546 B
TypeScript
22 lines
546 B
TypeScript
import * as exit from '../src/exit'
|
|
|
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
|
|
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)
|
|
})
|