unexpected-sinon
Advanced tools
Comparing version 10.6.0 to 10.6.1
@@ -141,2 +141,9 @@ /*global location*/ | ||
function getCallTimeLineFromSpies(spies) { | ||
// Get a flattened array of all calls to all the specified spies: | ||
return Array.prototype.concat.apply([], spies.map(getCalls)).sort(function (a, b) { | ||
return a.callId - b.callId; | ||
}); | ||
} | ||
return { | ||
@@ -562,2 +569,3 @@ name: 'unexpected-sinon', | ||
expect.addAssertion('<spy|array|sinonSandbox> to have no calls [exhaustively] satisfying <object>', function (expect, subject, value) { | ||
var spies = extractSpies(subject); | ||
var keys = Object.keys(value); | ||
@@ -575,4 +583,4 @@ if ( | ||
// Get a flattened array of all calls to all the specified spies: | ||
var calls = Array.prototype.concat.apply([], extractSpies(subject).map(getCalls)); | ||
var calls = getCallTimeLineFromSpies(spies); | ||
var promises = calls.map(function (call) { | ||
@@ -621,2 +629,3 @@ return expect.promise(function () { | ||
expect.addAssertion('<spy|array|sinonSandbox> to have a call [exhaustively] satisfying <object>', function (expect, subject, value) { | ||
var spies = extractSpies(subject); | ||
var keys = Object.keys(value); | ||
@@ -634,4 +643,4 @@ if ( | ||
// Get a flattened array of all calls to all the specified spies: | ||
var calls = Array.prototype.concat.apply([], extractSpies(subject).map(getCalls)); | ||
var calls = getCallTimeLineFromSpies(spies); | ||
var promises = calls.map(function (call) { | ||
@@ -678,2 +687,3 @@ return expect.promise(function () { | ||
expect.addAssertion('<spy|array|sinonSandbox> to have all calls [exhaustively] satisfying <object>', function (expect, subject, value) { | ||
var spies = extractSpies(subject); | ||
var keys = Object.keys(value); | ||
@@ -691,5 +701,3 @@ if ( | ||
// Get a flattened array of all calls to all the specified spies: | ||
var calls = Array.prototype.concat.apply([], extractSpies(subject).map(getCalls)); | ||
return expect(calls, 'to have items [exhaustively] satisfying', value); | ||
return expect(getCallTimeLineFromSpies(spies), 'to have items [exhaustively] satisfying', value); | ||
}); | ||
@@ -696,0 +704,0 @@ |
{ | ||
"name": "unexpected-sinon", | ||
"version": "10.6.0", | ||
"version": "10.6.1", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -37,4 +37,4 @@ "keywords": [ | ||
"coveralls": "2.11.3", | ||
"eslint": "2.7.0", | ||
"eslint-config-onelint": "1.0.2", | ||
"eslint": "2.13.1", | ||
"eslint-config-onelint": "1.2.0", | ||
"istanbul": "0.3.17", | ||
@@ -41,0 +41,0 @@ "mocha": "2.4.5", |
Sorry, the diff of this file is too big to display
407960
7201