humpty
Version:
Makes sure your changelogs mention your breaking changes
22 lines (20 loc) • 711 B
JavaScript
import printResults from "../src/printResults";
import singlePropWithTypeChange from "./inputs/printUnmentionedChanges/singlePropWithTypeChange";
describe("printResults()", () => {
/* eslint-disable no-console */
beforeEach(() => {
global.console = { log: jest.fn() };
});
describe("output format", () => {
test("default output should be text", () => {
printResults(singlePropWithTypeChange);
expect(console.log.mock.calls[0][0]).toContain("Found 1 breaking");
});
test("json output if requested", () => {
printResults(singlePropWithTypeChange, true);
expect(console.log.mock.calls[0][0]).toContain(
'"isDefaultExport": true,'
);
});
});
});