Socket
Socket
Sign inDemoInstall

sinon

Package Overview
Dependencies
Maintainers
4
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sinon - npm Package Compare versions

Comparing version 9.2.4 to 10.0.0

6

CHANGELOG.md
10.0.0 / 2021-03-22
==================
* Upgrade nise to 4.1.0
* Use @sinonjs/eslint-config@4 => Adopts ES2017 => Drops support for IE 11, Legacy Edge and legacy Safari
9.2.4 / 2021-01-23

@@ -3,0 +9,0 @@ ==================

57

CONTRIBUTING.md

@@ -5,9 +5,9 @@ # Contributing to Sinon.JS

* Look into [issues tagged `help-wanted`](https://github.com/sinonjs/sinon/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+wanted%22)
* Help [improve the documentation](https://github.com/sinonjs/sinon/tree/master/docs) published
- Look into [issues tagged `help-wanted`](https://github.com/sinonjs/sinon/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+wanted%22)
- Help [improve the documentation](https://github.com/sinonjs/sinon/tree/master/docs) published
at [the Sinon.JS website](https://sinonjs.org). [Documentation issues](https://github.com/sinonjs/sinon/issues?q=is%3Aopen+is%3Aissue+label%3ADocumentation).
* Help someone understand and use Sinon.JS on [Stack Overflow](https://stackoverflow.com/questions/tagged/sinon)
* Report an issue, please read instructions below
* Help with triaging the [issues](https://github.com/sinonjs/sinon/issues). The clearer they are, the more likely they are to be fixed soon.
* Contribute to the code base.
- Help someone understand and use Sinon.JS on [Stack Overflow](https://stackoverflow.com/questions/tagged/sinon)
- Report an issue, please read instructions below
- Help with triaging the [issues](https://github.com/sinonjs/sinon/issues). The clearer they are, the more likely they are to be fixed soon.
- Contribute to the code base.

@@ -24,9 +24,9 @@ ## Contributor Code of Conduct

* Which environment are you using? Browser? Node? Which version(s)?
* Which version of SinonJS?
* How are you loading SinonJS?
* What other libraries are you using?
* What you expected to happen
* What actually happens
* Describe **with code** how to reproduce the faulty behaviour
- Which environment are you using? Browser? Node? Which version(s)?
- Which version of SinonJS?
- How are you loading SinonJS?
- What other libraries are you using?
- What you expected to happen
- What actually happens
- Describe **with code** how to reproduce the faulty behaviour

@@ -49,5 +49,5 @@ See [our issue template](https://github.com/sinonjs/sinon/blob/master/.github/) for all details.

* They allow Sinon.JS users to understand the consequences of updating to a newer version
* They help contributors understand what is going on with the codebase, allowing features and fixes to be developed faster
* They save maintainers time when compiling the changelog for a new release
- They allow Sinon.JS users to understand the consequences of updating to a newer version
- They help contributors understand what is going on with the codebase, allowing features and fixes to be developed faster
- They save maintainers time when compiling the changelog for a new release

@@ -72,3 +72,2 @@ If you're already a few commits in by the time you read this, you can still [change your commit messages](https://help.github.com/articles/changing-a-commit-message/).

### Compatibility

@@ -84,5 +83,4 @@

The ESLint verification (which includes Prettier) will be run before unit tests in the CI environment. The build will fail if the source code does not pass the style check.
Both Prettier and ESLint will check the code in pre-commit hooks (when installed) and will be run before unit tests in the CI environment. The build will fail if the source code does not pass the checks.
You can run the linter locally:

@@ -94,3 +92,3 @@

You can fix a lot of lint and style violations automatically:
You can fix a lot of lint violations automatically:

@@ -101,2 +99,14 @@ ```

You can run prettier locally:
```
$ npm run prettier:check
```
You can fix style violations automatically:
```
$ npm run prettier:write
```
To ensure consistent reporting of lint warnings, you should use the same versions of ESLint and Prettier as defined in `package.json` (which is what the CI servers use).

@@ -121,5 +131,6 @@

Dev mode features:
* [watching related files](https://mochajs.org/#w---watch) to restart tests once changes are made
* using [Min reporter](https://mochajs.org/#min), which cleans the console each time tests run, so test results are always on top
- [watching related files](https://mochajs.org/#w---watch) to restart tests once changes are made
- using [Min reporter](https://mochajs.org/#min), which cleans the console each time tests run, so test results are always on top
Note that in dev mode tests run only in Node. Before creating your PR please ensure tests are passing in Phantom and WebWorker as well. To check this please use [Run the tests](#run-the-tests) instructions.

@@ -134,3 +145,1 @@

$ node build.js

@@ -34,7 +34,9 @@ "use strict";

createFakeServer: nise.fakeServer.create.bind(nise.fakeServer),
createFakeServerWithClock: nise.fakeServerWithClock.create.bind(nise.fakeServerWithClock),
createFakeServerWithClock: nise.fakeServerWithClock.create.bind(
nise.fakeServerWithClock
),
addBehavior: function(name, fn) {
addBehavior: function (name, fn) {
behavior.addBehavior(stub, name, fn);
}
},
};

@@ -41,0 +43,0 @@

@@ -24,3 +24,3 @@ "use strict";

forEach(args, function(method) {
forEach(args, function (method) {
if (!method) {

@@ -34,7 +34,7 @@ assert.fail("fake is not a spy");

if (typeof method !== "function") {
assert.fail(method + " is not a function");
assert.fail(`${method} is not a function`);
}
if (typeof method.getCall !== "function") {
assert.fail(method + " is not stubbed");
assert.fail(`${method} is not stubbed`);
}

@@ -54,6 +54,5 @@ }

assert.fail(
assertionMethod +
" takes 1 argument but was called with " +
(assertionArgs.length + 1) +
" arguments"
`${assertionMethod} takes 1 argument but was called with ${
assertionArgs.length + 1
} arguments`
);

@@ -81,3 +80,3 @@ }

assert[name] = function(fake) {
assert[name] = function (fake) {
verifyIsStub(fake);

@@ -93,7 +92,16 @@

} else {
failed = typeof fake[meth] === "function" ? !fake[meth].apply(fake, args) : !fake[meth];
failed =
typeof fake[meth] === "function"
? !fake[meth].apply(fake, args)
: !fake[meth];
}
if (failed) {
failAssertion(this, (fake.printf || fake.proxy.printf).apply(fake, concat([msg], args)));
failAssertion(
this,
(fake.printf || fake.proxy.printf).apply(
fake,
concat([msg], args)
)
);
} else {

@@ -108,3 +116,5 @@ assert.pass(name);

? prop
: prefix + stringSlice(prop, 0, 1).toUpperCase() + stringSlice(prop, 1);
: prefix +
stringSlice(prop, 0, 1).toUpperCase() +
stringSlice(prop, 1);
}

@@ -146,3 +156,6 @@

failAssertion(this, "expected " + expected + " to be called in order but were called as " + actual);
failAssertion(
this,
`expected ${expected} to be called in order but were called as ${actual}`
);
} else {

@@ -157,3 +170,5 @@ assert.pass("callOrder");

if (method.callCount !== count) {
var msg = "expected %n to be called " + timesInWords(count) + " but was called %c%C";
var msg = `expected %n to be called ${timesInWords(
count
)} but was called %c%C`;
failAssertion(this, method.printf(msg));

@@ -171,8 +186,13 @@ } else {

var o = options || {};
var prefix = (typeof o.prefix === "undefined" && "assert") || o.prefix;
var includeFail = typeof o.includeFail === "undefined" || Boolean(o.includeFail);
var prefix =
(typeof o.prefix === "undefined" && "assert") || o.prefix;
var includeFail =
typeof o.includeFail === "undefined" || Boolean(o.includeFail);
var instance = this;
forEach(Object.keys(instance), function(method) {
if (method !== "expose" && (includeFail || !/^(fail)/.test(method))) {
forEach(Object.keys(instance), function (method) {
if (
method !== "expose" &&
(includeFail || !/^(fail)/.test(method))
) {
target[exposedName(prefix, method)] = instance[method];

@@ -192,4 +212,4 @@ }

"expected value to match",
" expected = " + format(expectation),
" actual = " + format(actual)
` expected = ${format(expectation)}`,
` actual = ${format(actual)}`,
];

@@ -199,9 +219,12 @@

}
}
},
};
mirrorPropAsAssertion("called", "expected %n to have been called at least once but was never called");
mirrorPropAsAssertion(
"called",
"expected %n to have been called at least once but was never called"
);
mirrorPropAsAssertion(
"notCalled",
function(spy) {
function (spy) {
return !spy.called;

@@ -211,19 +234,67 @@ },

);
mirrorPropAsAssertion("calledOnce", "expected %n to be called once but was called %c%C");
mirrorPropAsAssertion("calledTwice", "expected %n to be called twice but was called %c%C");
mirrorPropAsAssertion("calledThrice", "expected %n to be called thrice but was called %c%C");
mirrorPropAsAssertion("calledOn", "expected %n to be called with %1 as this but was called with %t");
mirrorPropAsAssertion("alwaysCalledOn", "expected %n to always be called with %1 as this but was called with %t");
mirrorPropAsAssertion(
"calledOnce",
"expected %n to be called once but was called %c%C"
);
mirrorPropAsAssertion(
"calledTwice",
"expected %n to be called twice but was called %c%C"
);
mirrorPropAsAssertion(
"calledThrice",
"expected %n to be called thrice but was called %c%C"
);
mirrorPropAsAssertion(
"calledOn",
"expected %n to be called with %1 as this but was called with %t"
);
mirrorPropAsAssertion(
"alwaysCalledOn",
"expected %n to always be called with %1 as this but was called with %t"
);
mirrorPropAsAssertion("calledWithNew", "expected %n to be called with new");
mirrorPropAsAssertion("alwaysCalledWithNew", "expected %n to always be called with new");
mirrorPropAsAssertion("calledWith", "expected %n to be called with arguments %D");
mirrorPropAsAssertion("calledWithMatch", "expected %n to be called with match %D");
mirrorPropAsAssertion("alwaysCalledWith", "expected %n to always be called with arguments %D");
mirrorPropAsAssertion("alwaysCalledWithMatch", "expected %n to always be called with match %D");
mirrorPropAsAssertion("calledWithExactly", "expected %n to be called with exact arguments %D");
mirrorPropAsAssertion("calledOnceWithExactly", "expected %n to be called once and with exact arguments %D");
mirrorPropAsAssertion("calledOnceWithMatch", "expected %n to be called once and with match %D");
mirrorPropAsAssertion("alwaysCalledWithExactly", "expected %n to always be called with exact arguments %D");
mirrorPropAsAssertion("neverCalledWith", "expected %n to never be called with arguments %*%C");
mirrorPropAsAssertion("neverCalledWithMatch", "expected %n to never be called with match %*%C");
mirrorPropAsAssertion(
"alwaysCalledWithNew",
"expected %n to always be called with new"
);
mirrorPropAsAssertion(
"calledWith",
"expected %n to be called with arguments %D"
);
mirrorPropAsAssertion(
"calledWithMatch",
"expected %n to be called with match %D"
);
mirrorPropAsAssertion(
"alwaysCalledWith",
"expected %n to always be called with arguments %D"
);
mirrorPropAsAssertion(
"alwaysCalledWithMatch",
"expected %n to always be called with match %D"
);
mirrorPropAsAssertion(
"calledWithExactly",
"expected %n to be called with exact arguments %D"
);
mirrorPropAsAssertion(
"calledOnceWithExactly",
"expected %n to be called once and with exact arguments %D"
);
mirrorPropAsAssertion(
"calledOnceWithMatch",
"expected %n to be called once and with match %D"
);
mirrorPropAsAssertion(
"alwaysCalledWithExactly",
"expected %n to always be called with exact arguments %D"
);
mirrorPropAsAssertion(
"neverCalledWith",
"expected %n to never be called with arguments %*%C"
);
mirrorPropAsAssertion(
"neverCalledWithMatch",
"expected %n to never be called with match %*%C"
);
mirrorPropAsAssertion("threw", "%n did not throw exception%C");

@@ -230,0 +301,0 @@ mirrorPropAsAssertion("alwaysThrew", "%n did not always throw exception%C");

@@ -42,3 +42,7 @@ "use strict";

if (callArgProp && argumentList[i] && typeof argumentList[i][callArgProp] === "function") {
if (
callArgProp &&
argumentList[i] &&
typeof argumentList[i][callArgProp] === "function"
) {
return argumentList[i][callArgProp];

@@ -56,13 +60,15 @@ }

if (behavior.callArgProp) {
msg =
functionName(behavior.stub) +
" expected to yield to '" +
valueToString(behavior.callArgProp) +
"', but no object with such a property was passed.";
msg = `${functionName(
behavior.stub
)} expected to yield to '${valueToString(
behavior.callArgProp
)}', but no object with such a property was passed.`;
} else {
msg = functionName(behavior.stub) + " expected to yield, but no callback was passed.";
msg = `${functionName(
behavior.stub
)} expected to yield, but no callback was passed.`;
}
if (args.length > 0) {
msg += " Received [" + join(args, ", ") + "]";
msg += ` Received [${join(args, ", ")}]`;
}

@@ -73,3 +79,3 @@

return "argument at index " + behavior.callArgAt + " is not a function: " + func;
return `argument at index ${behavior.callArgAt} is not a function: ${func}`;
}

@@ -85,3 +91,5 @@

throw new TypeError(
name + " failed: " + (index + 1) + " arguments required but only " + args.length + " present"
`${name} failed: ${index + 1} arguments required but only ${
args.length
} present`
);

@@ -101,7 +109,13 @@ }

if (behavior.callbackAsync) {
nextTick(function() {
func.apply(behavior.callbackContext, behavior.callbackArguments);
nextTick(function () {
func.apply(
behavior.callbackContext,
behavior.callbackArguments
);
});
} else {
return func.apply(behavior.callbackContext, behavior.callbackArguments);
return func.apply(
behavior.callbackContext,
behavior.callbackArguments
);
}

@@ -171,3 +185,5 @@ }

ensureArgs("resolvesArg", this, args);
return (this.promiseLibrary || Promise).resolve(args[this.resolveArgAt]);
return (this.promiseLibrary || Promise).resolve(
args[this.resolveArgAt]
);
} else if (this.resolveThis) {

@@ -189,3 +205,6 @@ return (this.promiseLibrary || Promise).resolve(context);

// Call the constructor
var F = WrappedClass.bind.apply(WrappedClass, concat([null], argsArray));
var F = WrappedClass.bind.apply(
WrappedClass,
concat([null], argsArray)
);
return new F();

@@ -232,9 +251,12 @@ } else if (typeof this.returnValue !== "undefined") {

);
}
},
};
function createBehavior(behaviorMethod) {
return function() {
return function () {
this.defaultBehavior = this.defaultBehavior || proto.create(this);
this.defaultBehavior[behaviorMethod].apply(this.defaultBehavior, arguments);
this.defaultBehavior[behaviorMethod].apply(
this.defaultBehavior,
arguments
);
return this;

@@ -245,3 +267,3 @@ };

function addBehavior(stub, name, fn) {
proto[name] = function() {
proto[name] = function () {
fn.apply(this, concat([this], slice(arguments)));

@@ -248,0 +270,0 @@ return this.stub || this;

"use strict";
exports.isSupported = (function() {
exports.isSupported = (function () {
try {

@@ -5,0 +5,0 @@ return Boolean(new Blob());

@@ -5,7 +5,11 @@ "use strict";

var getPropertyDescriptor = require("./util/core/get-property-descriptor");
var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object
.hasOwnProperty;
var push = require("@sinonjs/commons").prototypes.array.push;
function collectMethod(methods, object, prop, propOwner) {
if (typeof getPropertyDescriptor(propOwner, prop).value === "function" && hasOwnProperty(object, prop)) {
if (
typeof getPropertyDescriptor(propOwner, prop).value === "function" &&
hasOwnProperty(object, prop)
) {
push(methods, object[prop]);

@@ -12,0 +16,0 @@ }

@@ -10,23 +10,23 @@ "use strict";

return "\x1b[" + color + "m" + str + "\x1b[0m";
return `\x1b[${color}m${str}\x1b[0m`;
}
exports.red = function(str) {
exports.red = function (str) {
return colorize(str, 31);
};
exports.green = function(str) {
exports.green = function (str) {
return colorize(str, 32);
};
exports.cyan = function(str) {
exports.cyan = function (str) {
return colorize(str, 96);
};
exports.white = function(str) {
exports.white = function (str) {
return colorize(str, 39);
};
exports.bold = function(str) {
exports.bold = function (str) {
return colorize(str, 1);
};

@@ -56,4 +56,5 @@ "use strict";

if (config.properties) {
forEach(config.properties, function(prop) {
var value = exposed[prop] || (prop === "sandbox" && configuredSandbox);
forEach(config.properties, function (prop) {
var value =
exposed[prop] || (prop === "sandbox" && configuredSandbox);
exposeValue(configuredSandbox, config, prop, value);

@@ -60,0 +61,0 @@ });

@@ -17,3 +17,3 @@ "use strict";

} else if (typeof error === "string") {
fake.exceptionCreator = function() {
fake.exceptionCreator = function () {
var newException = new Error(message || "");

@@ -24,3 +24,3 @@ newException.name = error;

} else if (!error) {
fake.exceptionCreator = function() {
fake.exceptionCreator = function () {
return new Error("Error");

@@ -90,3 +90,3 @@ };

yields: function(fake) {
yields: function (fake) {
fake.callArgAt = useLeftMostCallback;

@@ -99,3 +99,3 @@ fake.callbackArguments = slice(arguments, 1);

yieldsRight: function(fake) {
yieldsRight: function (fake) {
fake.callArgAt = useRightMostCallback;

@@ -108,3 +108,3 @@ fake.callbackArguments = slice(arguments, 1);

yieldsOn: function(fake, context) {
yieldsOn: function (fake, context) {
fake.callArgAt = useLeftMostCallback;

@@ -117,3 +117,3 @@ fake.callbackArguments = slice(arguments, 2);

yieldsTo: function(fake, prop) {
yieldsTo: function (fake, prop) {
fake.callArgAt = useLeftMostCallback;

@@ -126,3 +126,3 @@ fake.callbackArguments = slice(arguments, 2);

yieldsToOn: function(fake, prop, context) {
yieldsToOn: function (fake, prop, context) {
fake.callArgAt = useLeftMostCallback;

@@ -240,3 +240,6 @@ fake.callbackArguments = slice(arguments, 3);

get: getterFunction,
configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName)
configurable: isPropertyConfigurable(
rootStub.rootObj,
rootStub.propName
),
});

@@ -256,3 +259,6 @@

set: setterFunction,
configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName)
configurable: isPropertyConfigurable(
rootStub.rootObj,
rootStub.propName
),
}

@@ -270,7 +276,9 @@ );

enumerable: true,
configurable: rootStub.shadowsPropOnPrototype || isPropertyConfigurable(rootStub.rootObj, rootStub.propName)
configurable:
rootStub.shadowsPropOnPrototype ||
isPropertyConfigurable(rootStub.rootObj, rootStub.propName),
});
return fake;
}
},
};

@@ -277,0 +285,0 @@

@@ -16,3 +16,3 @@ "use strict";

var proxy;
var fakeInstance = function() {
var fakeInstance = function () {
var firstArg, lastArg;

@@ -25,3 +25,4 @@

var callback = lastArg && typeof lastArg === "function" ? lastArg : undefined;
var callback =
lastArg && typeof lastArg === "function" ? lastArg : undefined;

@@ -37,3 +38,3 @@ proxy.firstArg = firstArg;

proxy.displayName = "fake";
proxy.id = "fake#" + uuid++;
proxy.id = `fake#${uuid++}`;

@@ -101,3 +102,3 @@ return proxy;

if (async) {
nextTick(function() {
nextTick(function () {
callback.apply(null, values);

@@ -104,0 +105,0 @@ });

@@ -25,3 +25,3 @@ "use strict";

return "called " + timesInWords(callCount);
return `called ${timesInWords(callCount)}`;
}

@@ -37,3 +37,3 @@

if (min !== max) {
str = "at least " + str + " and at most " + timesInWords(max);
str = `at least ${str} and at most ${timesInWords(max)}`;
}

@@ -45,6 +45,6 @@

if (typeof min === "number") {
return "at least " + timesInWords(min);
return `at least ${timesInWords(min)}`;
}
return "at most " + timesInWords(max);
return `at most ${timesInWords(max)}`;
}

@@ -91,3 +91,3 @@

if (typeof num !== "number") {
throw new TypeError("'" + valueToString(num) + "' is not number");
throw new TypeError(`'${valueToString(num)}' is not number`);
}

@@ -107,3 +107,3 @@

if (typeof num !== "number") {
throw new TypeError("'" + valueToString(num) + "' is not number");
throw new TypeError(`'${valueToString(num)}' is not number`);
}

@@ -139,3 +139,3 @@

if (typeof num !== "number") {
throw new TypeError("'" + valueToString(num) + "' is not a number");
throw new TypeError(`'${valueToString(num)}' is not a number`);
}

@@ -156,3 +156,5 @@

this.failed = true;
mockExpectation.fail(this.method + " already called " + timesInWords(this.maxCalls));
mockExpectation.fail(
`${this.method} already called ${timesInWords(this.maxCalls)}`
);
}

@@ -162,7 +164,5 @@

mockExpectation.fail(
this.method +
" called with " +
valueToString(thisValue) +
" as thisValue, expected " +
valueToString(this.expectedThis)
`${this.method} called with ${valueToString(
thisValue
)} as thisValue, expected ${valueToString(this.expectedThis)}`
);

@@ -176,3 +176,7 @@ }

if (!args) {
mockExpectation.fail(this.method + " received no arguments, expected " + format(expectedArguments));
mockExpectation.fail(
`${this.method} received no arguments, expected ${format(
expectedArguments
)}`
);
}

@@ -182,17 +186,16 @@

mockExpectation.fail(
this.method +
" received too few arguments (" +
format(args) +
"), expected " +
format(expectedArguments)
`${this.method} received too few arguments (${format(
args
)}), expected ${format(expectedArguments)}`
);
}
if (this.expectsExactArgCount && args.length !== expectedArguments.length) {
if (
this.expectsExactArgCount &&
args.length !== expectedArguments.length
) {
mockExpectation.fail(
this.method +
" received too many arguments (" +
format(args) +
"), expected " +
format(expectedArguments)
`${this.method} received too many arguments (${format(
args
)}), expected ${format(expectedArguments)}`
);

@@ -203,10 +206,8 @@ }

expectedArguments,
function(expectedArgument, i) {
function (expectedArgument, i) {
if (!verifyMatcher(expectedArgument, args[i])) {
mockExpectation.fail(
this.method +
" received wrong arguments " +
format(args) +
", didn't match " +
String(expectedArguments)
`${this.method} received wrong arguments ${format(
args
)}, didn't match ${String(expectedArguments)}`
);

@@ -217,7 +218,5 @@ }

mockExpectation.fail(
this.method +
" received wrong arguments " +
format(args) +
", expected " +
format(expectedArguments)
`${this.method} received wrong arguments ${format(
args
)}, expected ${format(expectedArguments)}`
);

@@ -252,7 +251,10 @@ }

if (this.expectsExactArgCount && _args.length !== expectedArguments.length) {
if (
this.expectsExactArgCount &&
_args.length !== expectedArguments.length
) {
return false;
}
return every(expectedArguments, function(expectedArgument, i) {
return every(expectedArguments, function (expectedArgument, i) {
if (!verifyMatcher(expectedArgument, _args[i])) {

@@ -286,3 +288,3 @@ return false;

toString: function() {
toString: function () {
var args = slice(this.expectedArguments || []);

@@ -296,12 +298,15 @@

proxy: this.method || "anonymous mock expectation",
args: args
args: args,
});
var message = callStr.replace(", [...", "[, ...") + " " + expectedCallCountInWords(this);
var message = `${callStr.replace(
", [...",
"[, ..."
)} ${expectedCallCountInWords(this)}`;
if (this.met()) {
return "Expectation met: " + message;
return `Expectation met: ${message}`;
}
return "Expected " + message + " (" + callCountInWords(this.callCount) + ")";
return `Expected ${message} (${callCountInWords(this.callCount)})`;
},

@@ -328,5 +333,5 @@

throw exception;
}
},
};
module.exports = mockExpectation;

@@ -39,3 +39,3 @@ "use strict";

return every(arr1, function(element, i) {
return every(arr1, function (element, i) {
return deepEqual(arr2[i], element);

@@ -72,3 +72,3 @@ });

wrapMethod(this.object, method, function() {
wrapMethod(this.object, method, function () {
return mockObject.invokeMethod(method, this, arguments);

@@ -91,3 +91,3 @@ });

each(this.proxies, function(proxy) {
each(this.proxies, function (proxy) {
if (typeof object[proxy].restore === "function") {

@@ -104,4 +104,4 @@ object[proxy].restore();

each(this.proxies, function(proxy) {
each(expectations[proxy], function(expectation) {
each(this.proxies, function (proxy) {
each(expectations[proxy], function (expectation) {
if (!expectation.met()) {

@@ -135,15 +135,31 @@ push(messages, String(expectation));

/* eslint consistent-return: "off" */
var expectations = this.expectations && this.expectations[method] ? this.expectations[method] : [];
var expectations =
this.expectations && this.expectations[method]
? this.expectations[method]
: [];
var currentArgs = args || [];
var available;
var expectationsWithMatchingArgs = filter(expectations, function(expectation) {
var expectedArgs = expectation.expectedArguments || [];
var expectationsWithMatchingArgs = filter(
expectations,
function (expectation) {
var expectedArgs = expectation.expectedArguments || [];
return arrayEquals(expectedArgs, currentArgs, expectation.expectsExactArgCount);
});
return arrayEquals(
expectedArgs,
currentArgs,
expectation.expectsExactArgCount
);
}
);
var expectationsToApply = filter(expectationsWithMatchingArgs, function(expectation) {
return !expectation.met() && expectation.allowsCall(thisValue, args);
});
var expectationsToApply = filter(
expectationsWithMatchingArgs,
function (expectation) {
return (
!expectation.met() &&
expectation.allowsCall(thisValue, args)
);
}
);

@@ -157,3 +173,3 @@ if (expectationsToApply.length > 0) {

forEach(expectationsWithMatchingArgs, function(expectation) {
forEach(expectationsWithMatchingArgs, function (expectation) {
if (expectation.allowsCall(thisValue, args)) {

@@ -170,4 +186,4 @@ available = available || expectation;

forEach(expectations, function(expectation) {
push(messages, " " + String(expectation));
forEach(expectations, function (expectation) {
push(messages, ` ${String(expectation)}`);
});

@@ -177,7 +193,6 @@

messages,
"Unexpected call: " +
proxyCallToString.call({
proxy: method,
args: args
})
`Unexpected call: ${proxyCallToString.call({
proxy: method,
args: args,
})}`
);

@@ -196,14 +211,13 @@

this.failures,
"Unexpected call: " +
proxyCallToString.call({
proxy: method,
args: args,
stack: err.stack
})
`Unexpected call: ${proxyCallToString.call({
proxy: method,
args: args,
stack: err.stack,
})}`
);
mockExpectation.fail(join(messages, "\n"));
}
},
});
module.exports = mock;

@@ -30,3 +30,3 @@ "use strict";

) {
proxy[method] = function() {
proxy[method] = function () {
if (!this.called) {

@@ -49,3 +49,6 @@ if (notCalled) {

currentCall = this.getCall(i);
var returnValue = currentCall[actual || method].apply(currentCall, arguments);
var returnValue = currentCall[actual || method].apply(
currentCall,
arguments
);
push(returnValues, returnValue);

@@ -52,0 +55,0 @@ if (returnValue) {

@@ -20,3 +20,3 @@ "use strict";

if (args.length) {
msg += " Received [" + join(slice(args), ", ") + "]";
msg += ` Received [${join(slice(args), ", ")}]`;
}

@@ -44,3 +44,3 @@ throw new Error(msg);

calledWithArgs,
function(prev, arg, i) {
function (prev, arg, i) {
return prev && deepEqual(self.args[i], arg);

@@ -62,3 +62,3 @@ },

calledWithMatchArgs,
function(prev, expectation, i) {
function (prev, expectation, i) {
var actual = self.args[i];

@@ -73,3 +73,6 @@

calledWithExactly: function calledWithExactly() {
return arguments.length === this.args.length && this.calledWith.apply(this, arguments);
return (
arguments.length === this.args.length &&
this.calledWith.apply(this, arguments)
);
},

@@ -101,19 +104,19 @@

calledBefore: function(other) {
calledBefore: function (other) {
return this.callId < other.callId;
},
calledAfter: function(other) {
calledAfter: function (other) {
return this.callId > other.callId;
},
calledImmediatelyBefore: function(other) {
calledImmediatelyBefore: function (other) {
return this.callId === other.callId - 1;
},
calledImmediatelyAfter: function(other) {
calledImmediatelyAfter: function (other) {
return this.callId === other.callId + 1;
},
callArg: function(pos) {
callArg: function (pos) {
this.ensureArgIsAFunction(pos);

@@ -123,3 +126,3 @@ return this.args[pos]();

callArgOn: function(pos, thisValue) {
callArgOn: function (pos, thisValue) {
this.ensureArgIsAFunction(pos);

@@ -129,7 +132,10 @@ return this.args[pos].apply(thisValue);

callArgWith: function(pos) {
return this.callArgOnWith.apply(this, concat([pos, null], slice(arguments, 1)));
callArgWith: function (pos) {
return this.callArgOnWith.apply(
this,
concat([pos, null], slice(arguments, 1))
);
},
callArgOnWith: function(pos, thisValue) {
callArgOnWith: function (pos, thisValue) {
this.ensureArgIsAFunction(pos);

@@ -140,5 +146,7 @@ var args = slice(arguments, 2);

throwArg: function(pos) {
throwArg: function (pos) {
if (pos > this.args.length) {
throw new TypeError("Not enough arguments: " + pos + " required but only " + this.args.length + " present");
throw new TypeError(
`Not enough arguments: ${pos} required but only ${this.args.length} present`
);
}

@@ -149,9 +157,9 @@

yield: function() {
yield: function () {
return this.yieldOn.apply(this, concat([null], slice(arguments, 0)));
},
yieldOn: function(thisValue) {
yieldOn: function (thisValue) {
var args = slice(this.args);
var yieldFn = filter(args, function(arg) {
var yieldFn = filter(args, function (arg) {
return typeof arg === "function";

@@ -161,3 +169,7 @@ })[0];

if (!yieldFn) {
throwYieldError(this.proxy, " cannot yield since no callback was passed.", args);
throwYieldError(
this.proxy,
" cannot yield since no callback was passed.",
args
);
}

@@ -168,9 +180,12 @@

yieldTo: function(prop) {
return this.yieldToOn.apply(this, concat([prop, null], slice(arguments, 1)));
yieldTo: function (prop) {
return this.yieldToOn.apply(
this,
concat([prop, null], slice(arguments, 1))
);
},
yieldToOn: function(prop, thisValue) {
yieldToOn: function (prop, thisValue) {
var args = slice(this.args);
var yieldArg = filter(args, function(arg) {
var yieldArg = filter(args, function (arg) {
return arg && typeof arg[prop] === "function";

@@ -183,3 +198,5 @@ })[0];

this.proxy,
" cannot yield to '" + valueToString(prop) + "' since no callback was passed.",
` cannot yield to '${valueToString(
prop
)}' since no callback was passed.`,
args

@@ -192,4 +209,4 @@ );

toString: function() {
var callStr = this.proxy ? String(this.proxy) + "(" : "";
toString: function () {
var callStr = this.proxy ? `${String(this.proxy)}(` : "";
var formattedArgs;

@@ -201,17 +218,17 @@

formattedArgs = map(this.args, function(arg) {
formattedArgs = map(this.args, function (arg) {
return sinonFormat(arg);
});
callStr = callStr + join(formattedArgs, ", ") + ")";
callStr = `${callStr + join(formattedArgs, ", ")})`;
if (typeof this.returnValue !== "undefined") {
callStr += " => " + sinonFormat(this.returnValue);
callStr += ` => ${sinonFormat(this.returnValue)}`;
}
if (this.exception) {
callStr += " !" + this.exception.name;
callStr += ` !${this.exception.name}`;
if (this.exception.message) {
callStr += "(" + this.exception.message + ")";
callStr += `(${this.exception.message})`;
}

@@ -221,3 +238,6 @@ }

// Omit the error message and the two top stack frames in sinon itself:
callStr += (this.stack.split("\n")[3] || "unknown").replace(/^\s*(?:at\s+|@)?/, " at ");
callStr += (this.stack.split("\n")[3] || "unknown").replace(
/^\s*(?:at\s+|@)?/,
" at "
);
}

@@ -228,9 +248,10 @@

ensureArgIsAFunction: function(pos) {
ensureArgIsAFunction: function (pos) {
if (typeof this.args[pos] !== "function") {
throw new TypeError(
"Expected argument at position " + pos + " to be a Function, but was " + typeof this.args[pos]
`Expected argument at position ${pos} to be a Function, but was ${typeof this
.args[pos]}`
);
}
}
},
};

@@ -240,5 +261,5 @@ Object.defineProperty(callProto, "stack", {

configurable: true,
get: function() {
get: function () {
return (this.errorWithCallStack && this.errorWithCallStack.stack) || "";
}
},
});

@@ -248,3 +269,11 @@

function createProxyCall(proxy, thisValue, args, returnValue, exception, id, errorWithCallStack) {
function createProxyCall(
proxy,
thisValue,
args,
returnValue,
exception,
id,
errorWithCallStack
) {
if (typeof id !== "number") {

@@ -262,3 +291,4 @@ throw new TypeError("Call id is not a number");

var proxyCall = Object.create(callProto);
var callback = lastArg && typeof lastArg === "function" ? lastArg : undefined;
var callback =
lastArg && typeof lastArg === "function" ? lastArg : undefined;

@@ -265,0 +295,0 @@ proxyCall.proxy = proxy;

@@ -23,3 +23,3 @@ "use strict";

push(this.callIds, currentCallId);
forEach(matchings, function(matching) {
forEach(matchings, function (matching) {
proxyCallUtil.incrementCallCount(matching);

@@ -42,3 +42,6 @@ push(matching.thisValues, thisValue);

// Call through with `new`
returnValue = new (bind.apply(this.func || func, concat([thisValue], args)))();
returnValue = new (bind.apply(
this.func || func,
concat([thisValue], args)
))();

@@ -59,3 +62,3 @@ if (typeof returnValue !== "object") {

push(this.returnValues, returnValue);
forEach(matchings, function(matching) {
forEach(matchings, function (matching) {
push(matching.exceptions, exception);

@@ -75,3 +78,3 @@ push(matching.returnValues, returnValue);

push(this.errorsWithCallStack, err);
forEach(matchings, function(matching) {
forEach(matchings, function (matching) {
push(matching.errorsWithCallStack, err);

@@ -78,0 +81,0 @@ });

@@ -39,3 +39,3 @@ "use strict";

*/
matchingFakes: function(/*args, strict*/) {
matchingFakes: function (/*args, strict*/) {
return emptyFakes;

@@ -65,3 +65,3 @@ },

getCalls: function() {
getCalls: function () {
var calls = [];

@@ -102,3 +102,6 @@ var i;

return this.callIds[this.callCount - 1] === proxy.callIds[proxy.callCount - 1] - 1;
return (
this.callIds[this.callCount - 1] ===
proxy.callIds[proxy.callCount - 1] - 1
);
},

@@ -111,7 +114,10 @@

return this.callIds[this.callCount - 1] === proxy.callIds[proxy.callCount - 1] + 1;
return (
this.callIds[this.callCount - 1] ===
proxy.callIds[proxy.callCount - 1] + 1
);
},
formatters: require("./spy-formatters"),
printf: function(format) {
printf: function (format) {
var spyInstance = this;

@@ -121,3 +127,3 @@ var args = slice(arguments, 1);

return (format || "").replace(/%(.)/g, function(match, specifyer) {
return (format || "").replace(/%(.)/g, function (match, specifyer) {
formatter = proxyApi.formatters[specifyer];

@@ -131,7 +137,7 @@

return "%" + specifyer;
return `%${specifyer}`;
});
},
resetHistory: function() {
resetHistory: function () {
if (this.invoking) {

@@ -166,3 +172,3 @@ var err = new Error(

if (this.fakes) {
forEach(this.fakes, function(fake) {
forEach(this.fakes, function (fake) {
fake.resetHistory();

@@ -173,3 +179,3 @@ });

return this;
}
},
};

@@ -181,3 +187,11 @@

delegateToCalls(proxyApi, "calledWith", true);
delegateToCalls(proxyApi, "calledOnceWith", true, "calledWith", false, undefined, 1);
delegateToCalls(
proxyApi,
"calledOnceWith",
true,
"calledWith",
false,
undefined,
1
);
delegateToCalls(proxyApi, "calledWithMatch", true);

@@ -187,11 +201,46 @@ delegateToCalls(proxyApi, "alwaysCalledWith", false, "calledWith");

delegateToCalls(proxyApi, "calledWithExactly", true);
delegateToCalls(proxyApi, "calledOnceWithExactly", true, "calledWithExactly", false, undefined, 1);
delegateToCalls(proxyApi, "calledOnceWithMatch", true, "calledWithMatch", false, undefined, 1);
delegateToCalls(proxyApi, "alwaysCalledWithExactly", false, "calledWithExactly");
delegateToCalls(proxyApi, "neverCalledWith", false, "notCalledWith", false, function() {
return true;
});
delegateToCalls(proxyApi, "neverCalledWithMatch", false, "notCalledWithMatch", false, function() {
return true;
});
delegateToCalls(
proxyApi,
"calledOnceWithExactly",
true,
"calledWithExactly",
false,
undefined,
1
);
delegateToCalls(
proxyApi,
"calledOnceWithMatch",
true,
"calledWithMatch",
false,
undefined,
1
);
delegateToCalls(
proxyApi,
"alwaysCalledWithExactly",
false,
"calledWithExactly"
);
delegateToCalls(
proxyApi,
"neverCalledWith",
false,
"notCalledWith",
false,
function () {
return true;
}
);
delegateToCalls(
proxyApi,
"neverCalledWithMatch",
false,
"notCalledWithMatch",
false,
function () {
return true;
}
);
delegateToCalls(proxyApi, "threw", true);

@@ -322,3 +371,3 @@ delegateToCalls(proxyApi, "alwaysThrew", false, "threw");

callIds: [],
errorsWithCallStack: []
errorsWithCallStack: [],
});

@@ -325,0 +374,0 @@ return p;

@@ -25,7 +25,7 @@ "use strict";

function applyOnEach(fakes, method) {
var matchingFakes = filter(fakes, function(fake) {
var matchingFakes = filter(fakes, function (fake) {
return typeof fake[method] === "function";
});
forEach(matchingFakes, function(fake) {
forEach(matchingFakes, function (fake) {
fake[method]();

@@ -51,3 +51,3 @@ });

// this is for testing only
sandbox.getRestorers = function() {
sandbox.getRestorers = function () {
return fakeRestorers;

@@ -61,3 +61,3 @@ };

forEach(ownMethods, function(method) {
forEach(ownMethods, function (method) {
push(collection, method);

@@ -72,31 +72,31 @@ });

sandbox.inject = function inject(obj) {
obj.spy = function() {
obj.spy = function () {
return sandbox.spy.apply(null, arguments);
};
obj.stub = function() {
obj.stub = function () {
return sandbox.stub.apply(null, arguments);
};
obj.mock = function() {
obj.mock = function () {
return sandbox.mock.apply(null, arguments);
};
obj.createStubInstance = function() {
obj.createStubInstance = function () {
return sandbox.createStubInstance.apply(sandbox, arguments);
};
obj.fake = function() {
obj.fake = function () {
return sandbox.fake.apply(null, arguments);
};
obj.replace = function() {
obj.replace = function () {
return sandbox.replace.apply(null, arguments);
};
obj.replaceSetter = function() {
obj.replaceSetter = function () {
return sandbox.replaceSetter.apply(null, arguments);
};
obj.replaceGetter = function() {
obj.replaceGetter = function () {
return sandbox.replaceGetter.apply(null, arguments);

@@ -145,3 +145,3 @@ };

forEach(collection, function(fake) {
forEach(collection, function (fake) {
if (typeof fake === "function") {

@@ -167,3 +167,5 @@ privateResetHistory(fake);

if (arguments.length) {
throw new Error("sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()");
throw new Error(
"sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()"
);
}

@@ -175,3 +177,3 @@

forEach(fakeRestorers, function(restorer) {
forEach(fakeRestorers, function (restorer) {
restorer();

@@ -192,3 +194,3 @@ });

forEach(injectedKeys, function(injectedKey) {
forEach(injectedKeys, function (injectedKey) {
delete injectInto[injectedKey];

@@ -216,5 +218,10 @@ });

function verifyNotReplaced(object, property) {
forEach(fakeRestorers, function(fakeRestorer) {
if (fakeRestorer.object === object && fakeRestorer.property === property) {
throw new TypeError("Attempted to replace " + property + " which is already replaced");
forEach(fakeRestorers, function (fakeRestorer) {
if (
fakeRestorer.object === object &&
fakeRestorer.property === property
) {
throw new TypeError(
`Attempted to replace ${property} which is already replaced`
);
}

@@ -228,3 +235,7 @@ });

if (typeof descriptor === "undefined") {
throw new TypeError("Cannot replace non-existent property " + valueToString(property));
throw new TypeError(
`Cannot replace non-existent property ${valueToString(
property
)}`
);
}

@@ -245,3 +256,7 @@

if (typeof object[property] !== typeof replacement) {
throw new TypeError("Cannot replace " + typeof object[property] + " with " + typeof replacement);
throw new TypeError(
`Cannot replace ${typeof object[
property
]} with ${typeof replacement}`
);
}

@@ -259,11 +274,21 @@

sandbox.replaceGetter = function replaceGetter(object, property, replacement) {
sandbox.replaceGetter = function replaceGetter(
object,
property,
replacement
) {
var descriptor = getPropertyDescriptor(object, property);
if (typeof descriptor === "undefined") {
throw new TypeError("Cannot replace non-existent property " + valueToString(property));
throw new TypeError(
`Cannot replace non-existent property ${valueToString(
property
)}`
);
}
if (typeof replacement !== "function") {
throw new TypeError("Expected replacement argument to be a function");
throw new TypeError(
"Expected replacement argument to be a function"
);
}

@@ -282,3 +307,3 @@

get: replacement,
configurable: isPropertyConfigurable(object, property)
configurable: isPropertyConfigurable(object, property),
});

@@ -289,11 +314,21 @@

sandbox.replaceSetter = function replaceSetter(object, property, replacement) {
sandbox.replaceSetter = function replaceSetter(
object,
property,
replacement
) {
var descriptor = getPropertyDescriptor(object, property);
if (typeof descriptor === "undefined") {
throw new TypeError("Cannot replace non-existent property " + valueToString(property));
throw new TypeError(
`Cannot replace non-existent property ${valueToString(
property
)}`
);
}
if (typeof replacement !== "function") {
throw new TypeError("Expected replacement argument to be a function");
throw new TypeError(
"Expected replacement argument to be a function"
);
}

@@ -313,3 +348,3 @@

set: replacement,
configurable: isPropertyConfigurable(object, property)
configurable: isPropertyConfigurable(object, property),
});

@@ -324,3 +359,4 @@

var isSpyingOnEntireObject = typeof property === "undefined" && typeof object === "object";
var isSpyingOnEntireObject =
typeof property === "undefined" && typeof object === "object";

@@ -330,3 +366,3 @@ if (isSpyingOnEntireObject) {

forEach(ownMethods, function(method) {
forEach(ownMethods, function (method) {
push(collection, method);

@@ -363,6 +399,6 @@ });

forEach(Object.keys(sinonFake), function(key) {
forEach(Object.keys(sinonFake), function (key) {
var fakeBehavior = sinonFake[key];
if (typeof fakeBehavior === "function") {
sandbox.fake[key] = function() {
sandbox.fake[key] = function () {
var s = fakeBehavior.apply(fakeBehavior, arguments);

@@ -369,0 +405,0 @@

@@ -23,7 +23,7 @@ "use strict";

}
return calledArgumentMessage + " " + matcher.message;
return `${calledArgumentMessage} ${matcher.message}`;
}
function colorDiffText(diff) {
var objects = map(diff, function(part) {
var objects = map(diff, function (part) {
var text = part.value;

@@ -51,7 +51,7 @@ if (part.added) {

module.exports = {
c: function(spyInstance) {
c: function (spyInstance) {
return timesInWords(spyInstance.callCount);
},
n: function(spyInstance) {
n: function (spyInstance) {
// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods

@@ -61,3 +61,3 @@ return spyInstance.toString();

D: function(spyInstance, args) {
D: function (spyInstance, args) {
var message = "";

@@ -68,3 +68,3 @@

if (l > 1) {
message += "\nCall " + (i + 1) + ":";
message += `\nCall ${i + 1}:`;
}

@@ -74,3 +74,7 @@ var calledArgs = spyInstance.getCall(i).args;

for (var j = 0; j < calledArgs.length || j < expectedArgs.length; ++j) {
for (
var j = 0;
j < calledArgs.length || j < expectedArgs.length;
++j
) {
if (calledArgs[j]) {

@@ -86,8 +90,19 @@ calledArgs[j] = quoteStringValue(calledArgs[j]);

var calledArgMessage = j < calledArgs.length ? sinonFormat(calledArgs[j]) : "";
var calledArgMessage =
j < calledArgs.length ? sinonFormat(calledArgs[j]) : "";
if (match.isMatcher(expectedArgs[j])) {
message += colorSinonMatchText(expectedArgs[j], calledArgs[j], calledArgMessage);
message += colorSinonMatchText(
expectedArgs[j],
calledArgs[j],
calledArgMessage
);
} else {
var expectedArgMessage = j < expectedArgs.length ? sinonFormat(expectedArgs[j]) : "";
var diff = jsDiff.diffJson(calledArgMessage, expectedArgMessage);
var expectedArgMessage =
j < expectedArgs.length
? sinonFormat(expectedArgs[j])
: "";
var diff = jsDiff.diffJson(
calledArgMessage,
expectedArgMessage
);
message += colorDiffText(diff);

@@ -101,3 +116,3 @@ }

C: function(spyInstance) {
C: function (spyInstance) {
var calls = [];

@@ -107,5 +122,5 @@

// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
var stringifiedCall = " " + spyInstance.getCall(i).toString();
var stringifiedCall = ` ${spyInstance.getCall(i).toString()}`;
if (/\n/.test(calls[i - 1])) {
stringifiedCall = "\n" + stringifiedCall;
stringifiedCall = `\n${stringifiedCall}`;
}

@@ -115,6 +130,6 @@ push(calls, stringifiedCall);

return calls.length > 0 ? "\n" + join(calls, "\n") : "";
return calls.length > 0 ? `\n${join(calls, "\n")}` : "";
},
t: function(spyInstance) {
t: function (spyInstance) {
var objects = [];

@@ -129,5 +144,5 @@

"*": function(spyInstance, args) {
"*": function (spyInstance, args) {
return join(
map(args, function(arg) {
map(args, function (arg) {
return sinonFormat(arg);

@@ -137,3 +152,3 @@ }),

);
}
},
};

@@ -26,3 +26,6 @@ "use strict";

var margs = fake.matchingArguments;
if (margs.length <= args.length && deepEqual(slice(args, 0, margs.length), margs)) {
if (
margs.length <= args.length &&
deepEqual(slice(args, 0, margs.length), margs)
) {
return !strict || margs.length === args.length;

@@ -35,3 +38,3 @@ }

var spyApi = {
withArgs: function() {
withArgs: function () {
var args = slice(arguments);

@@ -49,7 +52,7 @@ var matching = pop(this.matchingFakes(args, true));

fake.withArgs = function() {
fake.withArgs = function () {
return original.withArgs.apply(original, arguments);
};
forEach(original.args, function(arg, i) {
forEach(original.args, function (arg, i) {
if (!matches(fake, arg)) {

@@ -73,7 +76,7 @@ return;

// Override proxy default implementation
matchingFakes: function(args, strict) {
return filter.call(this.fakes, function(fake) {
matchingFakes: function (args, strict) {
return filter.call(this.fakes, function (fake) {
return matches(fake, args, strict);
});
}
},
};

@@ -83,31 +86,52 @@

var delegateToCalls = proxyCallUtil.delegateToCalls;
delegateToCalls(spyApi, "callArg", false, "callArgWith", true, function() {
throw new Error(this.toString() + " cannot call arg since it was not yet invoked.");
delegateToCalls(spyApi, "callArg", false, "callArgWith", true, function () {
throw new Error(
`${this.toString()} cannot call arg since it was not yet invoked.`
);
});
spyApi.callArgWith = spyApi.callArg;
delegateToCalls(spyApi, "callArgOn", false, "callArgOnWith", true, function() {
throw new Error(this.toString() + " cannot call arg since it was not yet invoked.");
delegateToCalls(spyApi, "callArgOn", false, "callArgOnWith", true, function () {
throw new Error(
`${this.toString()} cannot call arg since it was not yet invoked.`
);
});
spyApi.callArgOnWith = spyApi.callArgOn;
delegateToCalls(spyApi, "throwArg", false, "throwArg", false, function() {
throw new Error(this.toString() + " cannot throw arg since it was not yet invoked.");
delegateToCalls(spyApi, "throwArg", false, "throwArg", false, function () {
throw new Error(
`${this.toString()} cannot throw arg since it was not yet invoked.`
);
});
delegateToCalls(spyApi, "yield", false, "yield", true, function() {
throw new Error(this.toString() + " cannot yield since it was not yet invoked.");
delegateToCalls(spyApi, "yield", false, "yield", true, function () {
throw new Error(
`${this.toString()} cannot yield since it was not yet invoked.`
);
});
// "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode.
spyApi.invokeCallback = spyApi.yield;
delegateToCalls(spyApi, "yieldOn", false, "yieldOn", true, function() {
throw new Error(this.toString() + " cannot yield since it was not yet invoked.");
});
delegateToCalls(spyApi, "yieldTo", false, "yieldTo", true, function(property) {
delegateToCalls(spyApi, "yieldOn", false, "yieldOn", true, function () {
throw new Error(
this.toString() + " cannot yield to '" + valueToString(property) + "' since it was not yet invoked."
`${this.toString()} cannot yield since it was not yet invoked.`
);
});
delegateToCalls(spyApi, "yieldToOn", false, "yieldToOn", true, function(property) {
delegateToCalls(spyApi, "yieldTo", false, "yieldTo", true, function (property) {
throw new Error(
this.toString() + " cannot yield to '" + valueToString(property) + "' since it was not yet invoked."
`${this.toString()} cannot yield to '${valueToString(
property
)}' since it was not yet invoked.`
);
});
delegateToCalls(
spyApi,
"yieldToOn",
false,
"yieldToOn",
true,
function (property) {
throw new Error(
`${this.toString()} cannot yield to '${valueToString(
property
)}' since it was not yet invoked.`
);
}
);

@@ -119,3 +143,3 @@ function createSpy(func) {

if (typeof funk !== "function") {
funk = function() {
funk = function () {
return;

@@ -135,3 +159,3 @@ };

instantiateFake: createSpy,
id: "spy#" + uuid++
id: `spy#${uuid++}`,
});

@@ -157,3 +181,3 @@ return proxy;

if (!object && !property) {
return createSpy(function() {
return createSpy(function () {
return;

@@ -170,3 +194,3 @@ });

forEach(types, function(type) {
forEach(types, function (type) {
descriptor[type] = createSpy(methodDesc[type]);

@@ -173,0 +197,0 @@ });

@@ -8,3 +8,4 @@ "use strict";

var functionName = require("@sinonjs/commons").functionName;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object
.hasOwnProperty;
var isNonExistentProperty = require("./util/core/is-non-existent-property");

@@ -36,4 +37,6 @@ var spy = require("./spy");

pop(
sort(matchings, function(a, b) {
return a.matchingArguments.length - b.matchingArguments.length;
sort(matchings, function (a, b) {
return (
a.matchingArguments.length - b.matchingArguments.length
);
})

@@ -57,3 +60,3 @@ ) || proxy;

behaviors: [],
id: "stub#" + uuid++
id: `stub#${uuid++}`,
});

@@ -66,3 +69,5 @@

if (arguments.length > 2) {
throw new TypeError("stub(obj, 'meth', fn) has been removed, see documentation");
throw new TypeError(
"stub(obj, 'meth', fn) has been removed, see documentation"
);
}

@@ -77,8 +82,12 @@

if (isNonExistentProperty(object, property)) {
throw new TypeError("Cannot stub non-existent property " + valueToString(property));
throw new TypeError(
`Cannot stub non-existent property ${valueToString(property)}`
);
}
var actualDescriptor = getPropertyDescriptor(object, property);
var isObjectOrFunction = typeof object === "object" || typeof object === "function";
var isStubbingEntireObject = typeof property === "undefined" && isObjectOrFunction;
var isObjectOrFunction =
typeof object === "object" || typeof object === "function";
var isStubbingEntireObject =
typeof property === "undefined" && isObjectOrFunction;
var isCreatingNewStub = !object && typeof property === "undefined";

@@ -88,3 +97,4 @@ var isStubbingNonFuncProperty =

typeof property !== "undefined" &&
(typeof actualDescriptor === "undefined" || typeof actualDescriptor.value !== "function");
(typeof actualDescriptor === "undefined" ||
typeof actualDescriptor.value !== "function");

@@ -99,3 +109,6 @@ if (isStubbingEntireObject) {

var func = typeof actualDescriptor.value === "function" ? actualDescriptor.value : null;
var func =
typeof actualDescriptor.value === "function"
? actualDescriptor.value
: null;
var s = createStub(func);

@@ -114,3 +127,3 @@

delete object[property];
}
},
});

@@ -121,3 +134,3 @@

stub.createStubInstance = function(constructor, overrides) {
stub.createStubInstance = function (constructor, overrides) {
if (typeof constructor !== "function") {

@@ -129,3 +142,3 @@ throw new TypeError("The constructor should be a function.");

forEach(Object.keys(overrides || {}), function(propertyName) {
forEach(Object.keys(overrides || {}), function (propertyName) {
if (propertyName in stubbedObject) {

@@ -139,3 +152,5 @@ var value = overrides[propertyName];

} else {
throw new Error("Cannot stub " + propertyName + ". Property does not exist!");
throw new Error(
`Cannot stub ${propertyName}. Property does not exist!`
);
}

@@ -152,3 +167,7 @@ });

function getDefaultBehavior(stubInstance) {
return stubInstance.defaultBehavior || getParentBehaviour(stubInstance) || behavior.create(stubInstance);
return (
stubInstance.defaultBehavior ||
getParentBehaviour(stubInstance) ||
behavior.create(stubInstance)
);
}

@@ -158,3 +177,5 @@

var currentBehavior = stubInstance.behaviors[stubInstance.callCount - 1];
return currentBehavior && currentBehavior.isPresent() ? currentBehavior : getDefaultBehavior(stubInstance);
return currentBehavior && currentBehavior.isPresent()
? currentBehavior
: getDefaultBehavior(stubInstance);
}

@@ -164,3 +185,3 @@ /*eslint-enable no-use-before-define*/

var proto = {
resetBehavior: function() {
resetBehavior: function () {
this.defaultBehavior = null;

@@ -177,3 +198,3 @@ this.behaviors = [];

forEach(this.fakes, function(fake) {
forEach(this.fakes, function (fake) {
fake.resetBehavior();

@@ -183,3 +204,3 @@ });

reset: function() {
reset: function () {
this.resetHistory();

@@ -212,10 +233,11 @@ this.resetBehavior();

if (this.defaultBehavior && this.defaultBehavior.promiseLibrary) {
fake.defaultBehavior = fake.defaultBehavior || behavior.create(fake);
fake.defaultBehavior =
fake.defaultBehavior || behavior.create(fake);
fake.defaultBehavior.promiseLibrary = this.defaultBehavior.promiseLibrary;
}
return fake;
}
},
};
forEach(Object.keys(behavior), function(method) {
forEach(Object.keys(behavior), function (method) {
if (

@@ -231,3 +253,3 @@ hasOwnProperty(behavior, method) &&

forEach(Object.keys(behaviors), function(method) {
forEach(Object.keys(behaviors), function (method) {
if (hasOwnProperty(behaviors, method) && !hasOwnProperty(proto, method)) {

@@ -234,0 +256,0 @@ behavior.addBehavior(stub, method, behaviors[method]);

@@ -7,3 +7,5 @@ "use strict";

var type = object === null ? "null" : "undefined";
throw new Error("Trying to stub property '" + valueToString(property) + "' of " + type);
throw new Error(
`Trying to stub property '${valueToString(property)}' of ${type}`
);
}

@@ -10,0 +12,0 @@ }

@@ -16,6 +16,6 @@ "use strict";

"replaceGetter",
"createStubInstance"
"createStubInstance",
],
useFakeTimers: true,
useFakeServer: true
useFakeServer: true,
};

@@ -9,6 +9,6 @@ "use strict";

Object.keys(behaviorMethods),
function(acc, method) {
function (acc, method) {
// need to avoid creating another async versions of the newly added async methods
if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) {
acc[method + "Async"] = function() {
acc[`${method}Async`] = function () {
var result = behaviorMethods[method].apply(this, arguments);

@@ -15,0 +15,0 @@ this.callbackAsync = true;

"use strict";
var arrayProto = require("@sinonjs/commons").prototypes.array;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object
.hasOwnProperty;
var join = arrayProto.join;
var push = arrayProto.push;
var slice = arrayProto.slice;
// Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
var hasDontEnumBug = (function() {
var hasDontEnumBug = (function () {
var obj = {
constructor: function() {
constructor: function () {
return "0";
},
toString: function() {
toString: function () {
return "1";
},
valueOf: function() {
valueOf: function () {
return "2";
},
toLocaleString: function() {
toLocaleString: function () {
return "3";
},
prototype: function() {
prototype: function () {
return "4";
},
isPrototypeOf: function() {
isPrototypeOf: function () {
return "5";
},
propertyIsEnumerable: function() {
propertyIsEnumerable: function () {
return "6";
},
hasOwnProperty: function() {
hasOwnProperty: function () {
return "7";
},
length: function() {
length: function () {
return "8";
},
unique: function() {
unique: function () {
return "9";
}
},
};

@@ -68,3 +68,7 @@

// See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
if (hasDontEnumBug && hasOwnProperty(source, "toString") && source.toString !== target.toString) {
if (
hasDontEnumBug &&
hasOwnProperty(source, "toString") &&
source.toString !== target.toString
) {
target.toString = source.toString;

@@ -80,25 +84,33 @@ }

*
* @arg {Object} target - The Object to extend
* @arg {Object[]} sources - Objects to copy properties from.
* @param {object} target - The Object to extend
* @param {object[]} sources - Objects to copy properties from.
*
* @returns {Object} the extended target
* @returns {object} the extended target
*/
module.exports = function extend(target /*, sources */) {
var sources = slice(arguments, 1);
module.exports = function extend(target, ...sources) {
return extendCommon(
target,
sources,
function copyValue(dest, source, prop) {
var destOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(
dest,
prop
);
var sourceOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(
source,
prop
);
return extendCommon(target, sources, function copyValue(dest, source, prop) {
var destOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(dest, prop);
var sourceOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(source, prop);
if (prop === "name" && !destOwnPropertyDescriptor.writable) {
return;
}
if (prop === "name" && !destOwnPropertyDescriptor.writable) {
return;
Object.defineProperty(dest, prop, {
configurable: sourceOwnPropertyDescriptor.configurable,
enumerable: sourceOwnPropertyDescriptor.enumerable,
writable: sourceOwnPropertyDescriptor.writable,
value: sourceOwnPropertyDescriptor.value,
});
}
Object.defineProperty(dest, prop, {
configurable: sourceOwnPropertyDescriptor.configurable,
enumerable: sourceOwnPropertyDescriptor.enumerable,
writable: sourceOwnPropertyDescriptor.writable,
value: sourceOwnPropertyDescriptor.value
});
});
);
};

@@ -109,18 +121,20 @@

*
* @arg {Object} target - The Object to extend
* @arg {Object[]} sources - Objects to copy properties from.
* @param {object} target - The Object to extend
* @param {object[]} sources - Objects to copy properties from.
*
* @returns {Object} the extended target
* @returns {object} the extended target
*/
module.exports.nonEnum = function extendNonEnum(target /*, sources */) {
var sources = slice(arguments, 1);
return extendCommon(target, sources, function copyProperty(dest, source, prop) {
Object.defineProperty(dest, prop, {
value: source[prop],
enumerable: false,
configurable: true,
writable: true
});
});
module.exports.nonEnum = function extendNonEnum(target, ...sources) {
return extendCommon(
target,
sources,
function copyProperty(dest, source, prop) {
Object.defineProperty(dest, prop, {
value: source[prop],
enumerable: false,
configurable: true,
writable: true,
});
}
);
};

@@ -14,3 +14,3 @@ "use strict";

format.setFormatter = function(aCustomFormatter) {
format.setFormatter = function (aCustomFormatter) {
if (typeof aCustomFormatter !== "function") {

@@ -17,0 +17,0 @@ throw new Error("format.setFormatter must be called with a function");

"use strict";
var defaultConfig = require("./default-config");
var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object
.hasOwnProperty;

@@ -13,3 +14,5 @@ module.exports = function getConfig(custom) {

if (hasOwnProperty(defaultConfig, prop)) {
config[prop] = hasOwnProperty(kustom, prop) ? kustom[prop] : defaultConfig[prop];
config[prop] = hasOwnProperty(kustom, prop)
? kustom[prop]
: defaultConfig[prop];
}

@@ -16,0 +19,0 @@ }

@@ -6,5 +6,10 @@ "use strict";

var descriptor;
var isOwn = Boolean(object && Object.getOwnPropertyDescriptor(object, property));
var isOwn = Boolean(
object && Object.getOwnPropertyDescriptor(object, property)
);
while (proto && !(descriptor = Object.getOwnPropertyDescriptor(proto, property))) {
while (
proto &&
!(descriptor = Object.getOwnPropertyDescriptor(proto, property))
) {
proto = Object.getPrototypeOf(proto);

@@ -11,0 +16,0 @@ }

@@ -10,10 +10,13 @@ "use strict";

*
* @param {Object} object The object to examine
* @param {object} object The object to examine
*
* @returns {Boolean} true when the object is a module
* @returns {boolean} true when the object is a module
*/
module.exports = function(object) {
module.exports = function (object) {
return (
object && typeof Symbol !== "undefined" && object[Symbol.toStringTag] === "Module" && Object.isSealed(object)
object &&
typeof Symbol !== "undefined" &&
object[Symbol.toStringTag] === "Module" &&
Object.isSealed(object)
);
};

@@ -5,9 +5,11 @@ "use strict";

* @param {*} object
* @param {String} property
* @returns whether a prop exists in the prototype chain
* @param {string} property
* @returns {boolean} whether a prop exists in the prototype chain
*/
function isNonExistentProperty(object, property) {
return object && typeof property !== "undefined" && !(property in object);
return Boolean(
object && typeof property !== "undefined" && !(property in object)
);
}
module.exports = isNonExistentProperty;
"use strict";
function isRestorable(obj) {
return typeof obj === "function" && typeof obj.restore === "function" && obj.restore.sinon;
return (
typeof obj === "function" &&
typeof obj.restore === "function" &&
obj.restore.sinon
);
}
module.exports = isRestorable;

@@ -8,3 +8,3 @@ "use strict";

if (object !== null && typeof object === "object") {
walk(object, function(prop) {
walk(object, function (prop) {
if (isRestorable(object[prop])) {

@@ -11,0 +11,0 @@ object[prop].restore();

@@ -6,3 +6,3 @@ "use strict";

module.exports = function timesInWords(count) {
return array[count] || (count || 0) + " times";
return array[count] || `${count || 0} times`;
};

@@ -13,6 +13,8 @@ "use strict";

if (!object) {
throw new Error("Trying to " + name + " object but received " + String(object));
throw new Error(
`Trying to ${name} object but received ${String(object)}`
);
}
walk(object, function(prop, propOwner) {
walk(object, function (prop, propOwner) {
// we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object

@@ -38,3 +40,3 @@ // is not Object.prototype

if (!called) {
throw new Error("Expected to " + name + " methods on object but found none");
throw new Error(`Expected to ${name} methods on object but found none`);
}

@@ -41,0 +43,0 @@

@@ -19,6 +19,10 @@ "use strict";

forEach(Object.getOwnPropertyNames(obj), function(k) {
forEach(Object.getOwnPropertyNames(obj), function (k) {
if (seen[k] !== true) {
seen[k] = true;
var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ? originalObj : obj;
var target =
typeof Object.getOwnPropertyDescriptor(obj, k).get ===
"function"
? originalObj
: obj;
iterator.call(context, k, target);

@@ -25,0 +29,0 @@ }

@@ -5,7 +5,11 @@ "use strict";

var extend = require("./extend");
var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty;
var hasOwnProperty = require("@sinonjs/commons").prototypes.object
.hasOwnProperty;
var valueToString = require("@sinonjs/commons").valueToString;
function isFunction(obj) {
return typeof obj === "function" || Boolean(obj && obj.constructor && obj.call && obj.apply);
return (
typeof obj === "function" ||
Boolean(obj && obj.constructor && obj.call && obj.apply)
);
}

@@ -30,3 +34,5 @@

if (typeof method !== "function" && typeof method !== "object") {
throw new TypeError("Method wrapper should be a function or a property descriptor");
throw new TypeError(
"Method wrapper should be a function or a property descriptor"
);
}

@@ -39,9 +45,19 @@

error = new TypeError(
"Attempted to wrap " + typeof wrappedMethod + " property " + valueToString(property) + " as function"
`Attempted to wrap ${typeof wrappedMethod} property ${valueToString(
property
)} as function`
);
} else if (wrappedMethod.restore && wrappedMethod.restore.sinon) {
error = new TypeError("Attempted to wrap " + valueToString(property) + " which is already wrapped");
error = new TypeError(
`Attempted to wrap ${valueToString(
property
)} which is already wrapped`
);
} else if (wrappedMethod.calledBefore) {
var verb = wrappedMethod.returns ? "stubbed" : "spied on";
error = new TypeError("Attempted to wrap " + valueToString(property) + " which is already " + verb);
error = new TypeError(
`Attempted to wrap ${valueToString(
property
)} which is already ${verb}`
);
}

@@ -51,3 +67,3 @@

if (wrappedMethod && wrappedMethod.stackTraceError) {
error.stack += "\n--------------\n" + wrappedMethod.stackTraceError.stack;
error.stack += `\n--------------\n${wrappedMethod.stackTraceError.stack}`;
}

@@ -68,7 +84,9 @@ throw error;

// Firefox has a problem when using hasOwn.call on objects from other frames.
/* eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods */
var owned = object.hasOwnProperty ? object.hasOwnProperty(property) : hasOwnProperty(object, property);
var owned = object.hasOwnProperty
? object.hasOwnProperty(property) // eslint-disable-line @sinonjs/no-prototype-methods/no-prototype-methods
: hasOwnProperty(object, property);
if (hasES5Support) {
var methodDesc = typeof method === "function" ? { value: method } : method;
var methodDesc =
typeof method === "function" ? { value: method } : method;
wrappedMethodDesc = getPropertyDescriptor(object, property);

@@ -78,10 +96,15 @@

error = new TypeError(
"Attempted to wrap " + typeof wrappedMethod + " property " + property + " as function"
`Attempted to wrap ${typeof wrappedMethod} property ${property} as function`
);
} else if (wrappedMethodDesc.restore && wrappedMethodDesc.restore.sinon) {
error = new TypeError("Attempted to wrap " + property + " which is already wrapped");
} else if (
wrappedMethodDesc.restore &&
wrappedMethodDesc.restore.sinon
) {
error = new TypeError(
`Attempted to wrap ${property} which is already wrapped`
);
}
if (error) {
if (wrappedMethodDesc && wrappedMethodDesc.stackTraceError) {
error.stack += "\n--------------\n" + wrappedMethodDesc.stackTraceError.stack;
error.stack += `\n--------------\n${wrappedMethodDesc.stackTraceError.stack}`;
}

@@ -124,3 +147,3 @@ throw error;

restore: function() {
restore: function () {
// For prototype properties try to reset by delete first.

@@ -152,3 +175,3 @@ // If this fails (ex: localStorage on mobile safari) then force a reset

}
}
},
});

@@ -155,0 +178,0 @@

@@ -25,14 +25,18 @@ "use strict";

/**
* @param {number|Date|Object} dateOrConfig The unix epoch value to install with (default 0)
* @returns {Object} Returns a lolex clock instance
* @param {number|Date|object} dateOrConfig The unix epoch value to install with (default 0)
* @returns {object} Returns a lolex clock instance
*/
exports.useFakeTimers = function(dateOrConfig) {
exports.useFakeTimers = function (dateOrConfig) {
var hasArguments = typeof dateOrConfig !== "undefined";
var argumentIsDateLike =
(typeof dateOrConfig === "number" || dateOrConfig instanceof Date) && arguments.length === 1;
var argumentIsObject = dateOrConfig !== null && typeof dateOrConfig === "object" && arguments.length === 1;
(typeof dateOrConfig === "number" || dateOrConfig instanceof Date) &&
arguments.length === 1;
var argumentIsObject =
dateOrConfig !== null &&
typeof dateOrConfig === "object" &&
arguments.length === 1;
if (!hasArguments) {
return createClock({
now: 0
now: 0,
});

@@ -43,3 +47,3 @@ }

return createClock({
now: dateOrConfig
now: dateOrConfig,
});

@@ -55,9 +59,11 @@ }

throw new TypeError("useFakeTimers expected epoch or config object. See https://github.com/sinonjs/sinon");
throw new TypeError(
"useFakeTimers expected epoch or config object. See https://github.com/sinonjs/sinon"
);
};
exports.clock = {
create: function(now) {
create: function (now) {
return FakeTimers.createClock(now);
}
},
};

@@ -70,3 +76,3 @@

clearInterval: clearInterval,
Date: Date
Date: Date,
};

@@ -73,0 +79,0 @@ addIfDefined(timers, "setImmediate");

@@ -18,3 +18,3 @@ {

],
"version": "9.2.4",
"version": "10.0.0",
"homepage": "https://sinonjs.org/",

@@ -55,3 +55,4 @@ "author": "Christian Johansen",

"prepublishOnly": "npm run build",
"prettier": "prettier lib/**/*.js test/**/*.js",
"prettier:check": "prettier --check '**/*.{js,css,md}'",
"prettier:write": "prettier --write '**/*.{js,css,md}'",
"preversion": "./scripts/preversion.sh",

@@ -69,5 +70,5 @@ "postversion": "./scripts/postversion.sh"

"lint-staged": {
"*.js": "eslint",
"*.mjs": "eslint --ext mjs --parser-options=sourceType:module",
"docs/**/*.md": "markdownlint"
"*.{js,css,md}": "prettier --check",
"*.js": "eslint --quiet",
"*.mjs": "eslint --quiet --ext mjs --parser-options=sourceType:module"
},

@@ -79,3 +80,3 @@ "dependencies": {

"diff": "^4.0.2",
"nise": "^4.0.4",
"nise": "^4.1.0",
"supports-color": "^7.1.0"

@@ -85,2 +86,3 @@ },

"@babel/core": "^7.8.3",
"@sinonjs/eslint-config": "^4.0.0",
"@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.0",

@@ -92,8 +94,2 @@ "@sinonjs/referee": "^6.1.0",

"dependency-check": "^4.1.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-config-sinon": "^3.0.0",
"eslint-plugin-ie11": "^1.0.0",
"eslint-plugin-mocha": "^6.1.0",
"eslint-plugin-prettier": "^3.1.0",
"esm": "^3.2.25",

@@ -105,3 +101,3 @@ "husky": "^4.2.1",

"nyc": "^15.0.0",
"prettier": "^1.18.2",
"prettier": "^2.2.1",
"proxyquire": "^2.1.3",

@@ -108,0 +104,0 @@ "proxyquire-universal": "^2.1.0",

@@ -52,8 +52,8 @@ <h1 align=center>

* No global pollution
* Easy to use
* Require minimal “integration”
* Easy to embed seamlessly with any testing framework
* Easily fake any interface
* Ship with ready-to-use fakes for XMLHttpRequest, timers and more
- No global pollution
- Easy to use
- Require minimal “integration”
- Easy to embed seamlessly with any testing framework
- Easily fake any interface
- Ship with ready-to-use fakes for XMLHttpRequest, timers and more

@@ -99,3 +99,2 @@ ## Contribute?

## Sponsors

@@ -102,0 +101,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc