Comparing version 0.3.1 to 0.4.0
@@ -30,3 +30,3 @@ var path = require('path') | ||
} | ||
if (! interceptors) { delete allInterceptors[hostKey]; } | ||
//if (! interceptors) { delete allInterceptors[hostKey]; } | ||
} | ||
@@ -330,3 +330,3 @@ | ||
if (interceptors && interceptors.length > 0) { | ||
if (interceptors) { | ||
return processRequest(interceptors, options, callback); | ||
@@ -333,0 +333,0 @@ } else { |
@@ -124,4 +124,8 @@ var path = require('path') | ||
function isDone() { | ||
return (Object.keys(interceptors).length === 0, "Mocks not yet satisfied:\n" + pendingMocks().join("\n")); | ||
} | ||
function done() { | ||
assert.ok(Object.keys(interceptors).length === 0, "Mocks not yet satisfied:\n" + pendingMocks().join("\n")); | ||
assert.ok(isDone); | ||
} | ||
@@ -180,2 +184,3 @@ | ||
, done: done | ||
, isDone: isDone | ||
, filteringPath: filteringPath | ||
@@ -182,0 +187,0 @@ , filteringRequestBody: filteringRequestBody |
{ "name" : "nock" | ||
, "description" : "HTTP Server mocking for Node.js" | ||
, "tags" : ["Mock", "HTTP", "testing", "isolation"] | ||
, "version" : "0.3.1" | ||
, "version" : "0.4.0" | ||
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com>" | ||
@@ -15,3 +15,3 @@ , "contributors" : | ||
, "bugs" : | ||
{ "web" : "http://github.com/pgte/nock/issues" } | ||
{ "url" : "http://github.com/pgte/nock/issues" } | ||
, "engines" : ["node >= 0.4.10"] | ||
@@ -18,0 +18,0 @@ , "main" : "./index" |
@@ -100,3 +100,3 @@ # Nock | ||
var scope = nock('http://api.myservice.com') | ||
.filterPath(/password=[^&]*/g, 'password=XXX') | ||
.filteringPath(/password=[^&]*/g, 'password=XXX') | ||
.get('/users/1?password=XXX') | ||
@@ -108,3 +108,3 @@ .reply(200, 'user'); | ||
var scope = nock('http://api.myservice.com') | ||
.filterPath(function(path) { | ||
.filteringPath(function(path) { | ||
return '/ABC'; | ||
@@ -124,3 +124,3 @@ }) | ||
var scope = nock('http://api.myservice.com') | ||
.filterRequestBody(/password=[^&]*/g, 'password=XXX') | ||
.filteringRequestBody(/password=[^&]*/g, 'password=XXX') | ||
.post('/users/1', 'data=ABC&password=XXX') | ||
@@ -132,3 +132,3 @@ .reply(201, 'OK'); | ||
var scope = nock('http://api.myservice.com') | ||
.filterRequestBody(function(path) { | ||
.filteringRequestBody(function(path) { | ||
return 'ABC'; | ||
@@ -157,2 +157,7 @@ }) | ||
## .isDone() | ||
You can also call `isDone()`, which will return a boolean saying if all the expectations are met or not (instead of throwing an exception); | ||
# Logging | ||
@@ -159,0 +164,0 @@ |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
33757
986
0
168
0
3