Socket
Socket
Sign inDemoInstall

nock

Package Overview
Dependencies
Maintainers
1
Versions
430
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nock - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

12

lib/intercept.js

@@ -14,2 +14,12 @@ var path = require('path')

function stringifyRequest(options) {
var method = options.method || 'GET';
var path = options.path;
var body = options.body;
if (typeof(body) !== 'string') {
body = body.toString();
}
return method + ' ' + path + ' ' + body;
}
function processRequest(interceptors, options, callback) {

@@ -49,3 +59,3 @@ var req = new EventEmitter()

if (interceptors.length < 1) { throw new Error("Nock: No match for HTTP request " + JSON.stringify(options)); }
if (interceptors.length < 1) { throw new Error("Nock: No match for HTTP request " + stringifyRequest(options)); }
interceptor = interceptors.splice(0, 1)[0];

@@ -52,0 +62,0 @@

2

package.json
{ "name" : "nock"
, "description" : "HTTP Server mocking for Node.js"
, "tags" : ["Mock", "HTTP", "testing", "isolation"]
, "version" : "0.1.2"
, "version" : "0.1.3"
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com>"

@@ -6,0 +6,0 @@ , "repository" :

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc