unexpected-sinon
Advanced tools
Comparing version 10.7.0 to 10.7.1
@@ -110,6 +110,4 @@ /*global location*/ | ||
// the expected calls are being recorded: | ||
var callCount = spy.callCount; | ||
spy.func = function () { | ||
var onCall = spy.onCall && spy.onCall(callCount); | ||
callCount += 1; | ||
var onCall = spy.onCall && spy.onCall(spy.behaviors.length); | ||
return onCall; | ||
@@ -134,3 +132,8 @@ }; | ||
var thisValue = spy.thisValues[j]; | ||
var calledWithNew = thisValue instanceof spy; | ||
var calledWithNew = false; | ||
try { | ||
// Can throw "Function has non-object prototype 'undefined' in instanceof check" | ||
// when spying on eg. console.log | ||
calledWithNew = thisValue instanceof spy; | ||
} catch (e) {} | ||
var expectedSpyCallSpec = { | ||
@@ -367,3 +370,9 @@ proxy: spy, | ||
if (typeof value.calledWithNew !== 'undefined') { | ||
return expect(subject.thisValue instanceof subject.proxy, 'to satisfy', value.calledWithNew); | ||
var calledWithNew = false; | ||
try { | ||
// Can throw "Function has non-object prototype 'undefined' in instanceof check" | ||
// when spying on eg. console.log | ||
calledWithNew = subject.thisValue instanceof subject.proxy; | ||
} catch (e) {} | ||
return expect(calledWithNew, 'to satisfy', value.calledWithNew); | ||
} | ||
@@ -370,0 +379,0 @@ }), |
{ | ||
"name": "unexpected-sinon", | ||
"version": "10.7.0", | ||
"version": "10.7.1", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
421472
7520