"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spyOnConsole = spyOnConsole;
const withCleanup_js_1 = require("./withCleanup.cjs");
const noOp = () => { };
const restore = (spy) => spy.mockRestore();
function spyOnConsole(...spyOn) {
    const spies = {};
    for (const key of spyOn) {
        // @ts-ignore
        spies[key] = jest.spyOn(console, key).mockImplementation(noOp);
    }
    return (0, withCleanup_js_1.withCleanup)(spies, (spies) => {
        for (const spy of Object.values(spies)) {
            restore(spy);
        }
    });
}
spyOnConsole.takeSnapshots = (...spyOn) => (0, withCleanup_js_1.withCleanup)(spyOnConsole(...spyOn), (spies) => {
    for (const spy of Object.values(spies)) {
        expect(spy).toMatchSnapshot();
    }
});
//# sourceMappingURL=spyOnConsole.cjs.map
