"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.enableFakeTimers = enableFakeTimers;
const withCleanup_js_1 = require("./withCleanup.cjs");
function enableFakeTimers(config) {
    if (global.Date.isFake === true) {
        // Nothing to do here, fake timers have already been set up.
        // That also means we don't want to clean that up later.
        return (0, withCleanup_js_1.withCleanup)({}, () => { });
    }
    jest.useFakeTimers(config);
    return (0, withCleanup_js_1.withCleanup)({}, () => {
        if (global.Date.isFake === true) {
            jest.runOnlyPendingTimers();
            jest.useRealTimers();
        }
    });
}
//# sourceMappingURL=enableFakeTimers.cjs.map
