Comparing version 8.1.1 to 9.0.0
9.0.0 / 2020-02-19 | ||
================== | ||
* Ignore errors on thisValue property accesses (#2216) | ||
* Add firstArg to spy calls and fakes. (#2150) | ||
* Drop Node 8 support | ||
8.1.1 / 2020-01-22 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -13,2 +13,6 @@ # Contributing to Sinon.JS | ||
## Contributor Code of Conduct | ||
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. | ||
## Reporting an issue | ||
@@ -15,0 +19,0 @@ |
@@ -17,5 +17,12 @@ "use strict"; | ||
var fakeInstance = function() { | ||
var lastArg = arguments.length > 0 ? arguments[arguments.length - 1] : undefined; | ||
var firstArg, lastArg; | ||
if (arguments.length > 0) { | ||
firstArg = arguments[0]; | ||
lastArg = arguments[arguments.length - 1]; | ||
} | ||
var callback = lastArg && typeof lastArg === "function" ? lastArg : undefined; | ||
proxy.firstArg = firstArg; | ||
proxy.lastArg = lastArg; | ||
@@ -22,0 +29,0 @@ proxy.callback = callback; |
@@ -236,4 +236,10 @@ "use strict"; | ||
var firstArg, lastArg; | ||
if (args.length > 0) { | ||
firstArg = args[0]; | ||
lastArg = args[args.length - 1]; | ||
} | ||
var proxyCall = Object.create(callProto); | ||
var lastArg = (args.length > 0 && args[args.length - 1]) || undefined; | ||
var callback = lastArg && typeof lastArg === "function" ? lastArg : undefined; | ||
@@ -244,2 +250,3 @@ | ||
proxyCall.args = args; | ||
proxyCall.firstArg = firstArg; | ||
proxyCall.lastArg = lastArg; | ||
@@ -246,0 +253,0 @@ proxyCall.callback = callback; |
@@ -151,2 +151,3 @@ "use strict"; | ||
this.args = []; | ||
this.firstArg = null; | ||
this.lastArg = null; | ||
@@ -301,2 +302,3 @@ this.returnValues = []; | ||
firstCall: null, | ||
firstArg: null, | ||
secondCall: null, | ||
@@ -303,0 +305,0 @@ thirdCall: null, |
@@ -11,5 +11,10 @@ "use strict"; | ||
// eslint-disable-next-line guard-for-in | ||
for (prop in thisValue) { | ||
if (thisValue[prop] === this) { | ||
return prop; | ||
try { | ||
if (thisValue[prop] === this) { | ||
return prop; | ||
} | ||
} catch (e) { | ||
// no-op - accessing props can throw an error, nothing to do here | ||
} | ||
@@ -16,0 +21,0 @@ } |
"use strict"; | ||
var extend = require("./core/extend"); | ||
var llx = require("lolex"); | ||
var FakeTimers = require("@sinonjs/fake-timers"); | ||
var globalObject = require("@sinonjs/commons").global; | ||
function createClock(config, globalCtx) { | ||
var llxCtx = llx; | ||
var FakeTimersCtx = FakeTimers; | ||
if (globalCtx !== null && typeof globalCtx === "object") { | ||
llxCtx = llx.withGlobal(globalCtx); | ||
FakeTimersCtx = FakeTimers.withGlobal(globalCtx); | ||
} | ||
var clock = llxCtx.install(config); | ||
var clock = FakeTimersCtx.install(config); | ||
clock.restore = clock.uninstall; | ||
@@ -58,3 +58,3 @@ return clock; | ||
create: function(now) { | ||
return llx.createClock(now); | ||
return FakeTimers.createClock(now); | ||
} | ||
@@ -61,0 +61,0 @@ }; |
{ | ||
"name": "sinon", | ||
"description": "JavaScript test spies, stubs and mocks.", | ||
"version": "8.1.1", | ||
"version": "9.0.0", | ||
"homepage": "https://sinonjs.org/", | ||
@@ -60,7 +60,7 @@ "author": "Christian Johansen", | ||
"@sinonjs/commons": "^1.7.0", | ||
"@sinonjs/formatio": "^4.0.1", | ||
"@sinonjs/samsam": "^4.2.2", | ||
"@sinonjs/fake-timers": "^6.0.0", | ||
"@sinonjs/formatio": "^5.0.0", | ||
"@sinonjs/samsam": "^5.0.1", | ||
"diff": "^4.0.2", | ||
"lolex": "^5.1.2", | ||
"nise": "^3.0.1", | ||
"nise": "^4.0.1", | ||
"supports-color": "^7.1.0" | ||
@@ -83,5 +83,5 @@ }, | ||
"esm": "^3.2.25", | ||
"husky": "^3.0.8", | ||
"lint-staged": "^9.4.1", | ||
"markdownlint-cli": "^0.20.0", | ||
"husky": "^4.2.1", | ||
"lint-staged": "^10.0.7", | ||
"markdownlint-cli": "^0.21.0", | ||
"mocha": "^6.2.0", | ||
@@ -95,3 +95,3 @@ "mochify": "^6.6.0", | ||
"proxyquireify": "^3.2.1", | ||
"puppeteer": "^1.19.0", | ||
"puppeteer": "^2.1.0", | ||
"rimraf": "^3.0.0" | ||
@@ -98,0 +98,0 @@ }, |
@@ -23,2 +23,3 @@ <h1 align=center> | ||
<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> | ||
<a href="CODE_OF_CONDUCT.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg" alt="Contributor Covenant" /></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
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4718999
55192
150
+ Added@sinonjs/fake-timers@^6.0.0
+ Added@sinonjs/fake-timers@6.0.1(transitive)
+ Added@sinonjs/formatio@5.0.1(transitive)
+ Added@sinonjs/samsam@5.3.1(transitive)
+ Addednise@4.1.0(transitive)
- Removedlolex@^5.1.2
- Removed@sinonjs/formatio@4.0.1(transitive)
- Removed@sinonjs/samsam@4.2.2(transitive)
- Removedlolex@5.1.2(transitive)
- Removednise@3.0.1(transitive)
Updated@sinonjs/formatio@^5.0.0
Updated@sinonjs/samsam@^5.0.1
Updatednise@^4.0.1