How to use the lolex.withGlobal function in lolex

To help you get started, we’ve selected a few lolex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sinonjs / sinon / lib / sinon / util / fake-timers.js View on Github external
function createClock(config, globalCtx) {
    var llxCtx = llx;
    if (globalCtx !== null && typeof globalCtx === "object") {
        llxCtx = llx.withGlobal(globalCtx);
    }
    var clock = llxCtx.install(config);
    clock.restore = clock.uninstall;
    return clock;
}

lolex

Fake JavaScript timers

BSD-3-Clause
Latest version published 5 years ago

Package Health Score

64 / 100
Full package analysis