Comparing version 0.9.1 to 0.9.2
@@ -109,3 +109,19 @@ var path = require('path'); | ||
var expectation = this.expectations[0]; | ||
var validExpectations = []; | ||
for (var i = 0, l = this.expectations.length; i < l; i++) { | ||
var expectation = this.expectations[i]; | ||
if (expectation.count > 0) { | ||
validExpectations.push(expectation); | ||
} | ||
} | ||
this.expectations = []; // reset so that no duplicate verification attempts are made | ||
if (!validExpectations.length) { | ||
return; | ||
} | ||
var expectation = validExpectations[0]; | ||
throw new Error | ||
@@ -137,3 +153,3 @@ ( 'Expected call to '+expectation.name+' did not happen' | ||
// and no more expectations on that object | ||
has_more_expectations = this.expectations.reduce(function (memo, expectation) { | ||
var has_more_expectations = this.expectations.reduce(function (memo, expectation) { | ||
return memo || (expectation.obj === obj && expectation.method === method); | ||
@@ -140,0 +156,0 @@ }, false); |
{ | ||
"name": "gently", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"directories": { | ||
@@ -12,3 +12,4 @@ "lib": "./lib/gently" | ||
"node": "*" | ||
} | ||
} | ||
}, | ||
"optionalDependencies": {} | ||
} |
@@ -337,1 +337,13 @@ require('../common'); | ||
}); | ||
test(function verifyExpectNone() { | ||
var OBJ = {toString: function() {return '[OBJ]'}}; | ||
gently.verify(); | ||
gently.expect(OBJ, 'foo', 0); | ||
try { | ||
gently.verify(); | ||
} catch (e) { | ||
assert.fail('Exception should not have been thrown'); | ||
} | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
19944
469
0
1