import { withCleanup } from "./withCleanup.js";
const noOp = () => { };
const restore = (spy) => spy.mockRestore();
export function spyOnConsole(...spyOn) {
    const spies = {};
    for (const key of spyOn) {
        // @ts-ignore
        spies[key] = jest.spyOn(console, key).mockImplementation(noOp);
    }
    return withCleanup(spies, (spies) => {
        for (const spy of Object.values(spies)) {
            restore(spy);
        }
    });
}
spyOnConsole.takeSnapshots = (...spyOn) => withCleanup(spyOnConsole(...spyOn), (spies) => {
    for (const spy of Object.values(spies)) {
        expect(spy).toMatchSnapshot();
    }
});
//# sourceMappingURL=spyOnConsole.js.map
