Comparing version 1.0.0 to 1.1.0
@@ -88,3 +88,3 @@ const Request = require('./request'); | ||
if (this._assertions.length) { | ||
this._assertions = this._assertions.filter((request) => request.isDone()); | ||
this._assertions = this.getUnusedAssertions(); | ||
@@ -353,2 +353,6 @@ if (this._assertions.length) { | ||
} | ||
getUnusedAssertions() { | ||
return this._assertions.filter((request) => request.isDone()); | ||
} | ||
} | ||
@@ -355,0 +359,0 @@ |
{ | ||
"name": "zt-hock", | ||
"description": "A mocking server for HTTP requests, forked from Hock", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"author": "Joachim Seminck <joachim@seminck.be>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -220,2 +220,10 @@ const request = require('request'); | ||
it('unmatched requests should show up with getUnusedAssertions()', function() { | ||
this.hockInstance | ||
.head('/head') | ||
.reply(200, '', { 'Content-Type': 'plain/text' }); | ||
expect(this.hockInstance.getUnusedAssertions().length).toBe(1); | ||
}); | ||
it('should work with a delay configured', function(done) { | ||
@@ -222,0 +230,0 @@ this.hockInstance |
144893
1494