Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sinon

Package Overview
Dependencies
Maintainers
2
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 1.9.0 to 1.9.1

pkg/sinon-1.9.1.js

15

lib/sinon.js

@@ -44,2 +44,6 @@ /*jslint eqeqeq: false, onevar: false, forin: true, nomen: false, regexp: false, plusplus: false*/

function isReallyNaN(val) {
return typeof val === 'number' && isNaN(val);
}
function mirrorProperties(target, source) {

@@ -146,4 +150,9 @@ for (var prop in source) {

}
if (typeof a != "object" || typeof b != "object") {
return a === b;
if (typeof a != 'object' || typeof b != 'object') {
if (isReallyNaN(a) && isReallyNaN(b)) {
return true;
} else {
return a === b;
}
}

@@ -164,3 +173,3 @@

if (a instanceof RegExp && b instanceof RegExp) {
return (a.source === b.source) && (a.global === b.global) &&
return (a.source === b.source) && (a.global === b.global) &&
(a.ignoreCase === b.ignoreCase) && (a.multiline === b.multiline);

@@ -167,0 +176,0 @@ }

18

lib/sinon/util/fake_timers.js

@@ -27,2 +27,9 @@ /*jslint eqeqeq: false, plusplus: false, evil: true, onevar: false, browser: true, forin: false*/

(function (global) {
// node expects setTimeout/setInterval to return a fn object w/ .ref()/.unref()
// browsers, a number.
// see https://github.com/cjohansen/Sinon.JS/pull/436
var timeoutResult = setTimeout(function() {}, 0);
var addTimerReturnsObject = typeof timeoutResult === 'object';
clearTimeout(timeoutResult);
var id = 1;

@@ -57,3 +64,12 @@

return toId;
if (addTimerReturnsObject) {
return {
id: toId,
ref: function() {},
unref: function() {}
};
}
else {
return toId;
}
}

@@ -60,0 +76,0 @@

{
"name": "sinon",
"description": "JavaScript test spies, stubs and mocks.",
"version": "1.9.0",
"version": "1.9.1",
"homepage": "http://cjohansen.no/sinon/",

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

"dependencies": {
"formatio": "~1.0"
"formatio": "~1.0",
"util": ">=0.10.3 <1"
},

@@ -28,0 +29,0 @@ "devDependencies": {

/**
* Sinon.JS 1.9.0, 2014/03/05
* Sinon.JS 1.9.1, 2014/04/03
*

@@ -4,0 +4,0 @@ * @author Christian Johansen (christian@cjohansen.no)

@@ -366,2 +366,6 @@ /*jslint onevar: false, eqeqeq: false*/

"passes NaN and NaN": function () {
assert(sinon.deepEqual(NaN, NaN));
},
"passes equal objects": function () {

@@ -368,0 +372,0 @@ var obj1 = { a: 1, b: 2, c: 3, d: "hey", e: "there" };

@@ -858,5 +858,12 @@ /*jslint onevar: false, eqeqeq: false, plusplus: false*/

var id = setTimeout(stub, 1000);
var to = setTimeout(stub, 1000);
assert.isNumber(id);
if (typeof (setTimeout(function() {}, 0)) === 'object') {
assert.isNumber(to.id);
assert.isFunction(to.ref);
assert.isFunction(to.unref);
}
else {
assert.isNumber(to);
}
},

@@ -863,0 +870,0 @@

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