New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sinon

Package Overview
Dependencies
Maintainers
4
Versions
208
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 3.2.1 to 3.3.0

History.md

32

lib/sinon/match.js

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

var functionName = require("./util/core/function-name");
var get = require("lodash.get");
var iterableToString = require("./util/core/iterable-to-string");

@@ -21,2 +22,8 @@ var typeOf = require("./util/core/typeOf");

function assertMethodExists(value, method, name, methodPath) {
if (value[method] == null) {
throw new TypeError("Expected " + name + " to have method " + methodPath);
}
}
var matcher = {

@@ -184,6 +191,10 @@ toString: function () {

match.instanceOf = function (type) {
assertType(type, "function", "type");
if (typeof Symbol === "undefined" || typeof Symbol.hasInstance === "undefined") {
assertType(type, "function", "type");
} else {
assertMethodExists(type, Symbol.hasInstance, "type", "[Symbol.hasInstance]");
}
return match(function (actual) {
return actual instanceof type;
}, "instanceOf(" + functionName(type) + ")");
}, "instanceOf(" + (functionName(type) || Object.prototype.toString.call(type)) + ")");
};

@@ -221,2 +232,19 @@

match.hasNested = function (property, value) {
assertType(property, "string", "property");
var onlyProperty = arguments.length === 1;
var message = "hasNested(\"" + property + "\"";
if (!onlyProperty) {
message += ", " + valueToString(value);
}
message += ")";
return match(function (actual) {
if (actual === undefined || actual === null ||
get(actual, property) === undefined) {
return false;
}
return onlyProperty || deepEqual(value, get(actual, property));
}, message);
};
match.array = match.typeOf("array");

@@ -223,0 +251,0 @@

@@ -74,2 +74,3 @@ "use strict";

var expectation = mockExpectation.create(method);
extend(expectation, this.object[method]);
push.call(this.expectations[method], expectation);

@@ -76,0 +77,0 @@

4

lib/sinon/sandbox-stub.js

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

var stubbed = isStubbingNonFuncProperty ?
stubNonFunctionProperty.apply(null, arguments) :
sinonStub.apply(null, arguments);
stubNonFunctionProperty.apply(null, arguments) :
sinonStub.apply(null, arguments);

@@ -27,0 +27,0 @@ if (isStubbingEntireObject) {

@@ -248,4 +248,4 @@ "use strict";

return spyCall(this, this.thisValues[i], this.args[i],
this.returnValues[i], this.exceptions[i],
this.callIds[i], this.errorsWithCallStack[i]);
this.returnValues[i], this.exceptions[i],
this.callIds[i], this.errorsWithCallStack[i]);
},

@@ -252,0 +252,0 @@

{
"name": "sinon",
"description": "JavaScript test spies, stubs and mocks.",
"version": "3.2.1",
"version": "3.3.0",
"homepage": "http://sinonjs.org/",

@@ -38,4 +38,6 @@ "author": "Christian Johansen",

"dependencies": {
"build": "^0.1.4",
"diff": "^3.1.0",
"formatio": "1.2.0",
"lodash.get": "^4.4.2",
"lolex": "^2.1.2",

@@ -51,3 +53,3 @@ "native-promise-only": "^0.8.1",

"browserify": "^14.0.0",
"eslint": "^3.1.1",
"eslint": "^4.6.1",
"eslint-config-sinon": "^1.0.0",

@@ -85,3 +87,3 @@ "eslint-plugin-mocha": "^4.2.0",

"CONTRIBUTING.md",
"Changelog.txt",
"History.md",
"LICENSE",

@@ -88,0 +90,0 @@ "README.md"

@@ -23,2 +23,3 @@ <h1 align=center>

<a href="https://www.npmjs.com/package/sinon" target="_blank"><img src="https://img.shields.io/npm/dm/sinon.svg" alt="npm downloads per month"></a>
<a href="https://cdnjs.com/libraries/sinon.js" target="_blank"><img src="https://img.shields.io/cdnjs/v/sinon.js.svg" alt="CDNJS version"></a>
</p>

@@ -25,0 +26,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

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