How to use the @sinonjs/commons.global function in @sinonjs/commons

To help you get started, we’ve selected a few @sinonjs/commons 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 / lolex / lolex.js View on Github external
},{}],20:[function(require,module,exports){
"use strict";

var globalObject = require("@sinonjs/commons").global;

// eslint-disable-next-line complexity
function withGlobal(_global) {
    var userAgent = _global.navigator && _global.navigator.userAgent;
    var isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1;
    var maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint
    var NOOP = function() {
        return undefined;
    };
    var NOOP_ARRAY = function() {
        return [];
    };
    var timeoutResult = _global.setTimeout(NOOP, 0);
    var addTimerReturnsObject = typeof timeoutResult === "object";
    var hrtimePresent =
        _global.process && typeof _global.process.hrtime === "function";
github sinonjs / lolex / src / lolex-src.js View on Github external
"use strict";

var globalObject = require("@sinonjs/commons").global;

// eslint-disable-next-line complexity
function withGlobal(_global) {
    var userAgent = _global.navigator && _global.navigator.userAgent;
    var isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1;
    var maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint
    var NOOP = function() {
        return undefined;
    };
    var NOOP_ARRAY = function() {
        return [];
    };
    var timeoutResult = _global.setTimeout(NOOP, 0);
    var addTimerReturnsObject = typeof timeoutResult === "object";
    var hrtimePresent =
        _global.process && typeof _global.process.hrtime === "function";
github sinonjs / sinon / lib / sinon / util / core / next-tick.js View on Github external
"use strict";

var globalObject = require("@sinonjs/commons").global;
var getNextTick = require("./get-next-tick");

module.exports = getNextTick(globalObject.process, globalObject.setImmediate);