humpty
Version:
Makes sure your changelogs mention your breaking changes
16 lines (13 loc) • 383 B
JavaScript
import exitWithCode from "../src/exitWithCode";
describe("exitWithCode()", () => {
/* eslint-disable no-console */
beforeEach(() => {
global.process = { exit: jest.fn() };
});
[0, 1].forEach(exitCode => {
test(`should exit with code "${exitCode}"`, () => {
exitWithCode(exitCode);
expect(process.exit.mock.calls[0][0]).toBe(exitCode);
});
});
});