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.5.4 to 0.5.5

2

lib/recorder.js

@@ -28,5 +28,3 @@ var http = require('http');

if (requestBody) {
ret.push(", '");
ret.push(JSON.stringify(requestBody));
ret.push("'");
}

@@ -33,0 +31,0 @@ ret.push(")\n");

2

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

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

@@ -691,1 +691,34 @@ var nock = require('../.')

});
tap.test("same URI", function(t) {
var scope = nock('http://sameurii.com')
.get('/abc')
.reply(200, 'first one')
.get('/abc')
.reply(200, 'second one');
http.get({
host: 'sameurii.com'
, path: '/abc'
}, function(res) {
res.on('data', function(data) {
res.setEncoding('utf8');
t.equal(data.toString(), 'first one', 'should be qual to first reply');
res.on('end', function() {
http.get({
host: 'sameurii.com'
, path: '/abc'
}, function(res) {
res.setEncoding('utf8');
res.on('data', function(data) {
t.equal(data.toString(), 'second one', 'should be qual to second reply');
res.on('end', function() {
scope.done();
t.end();
});
});
});
});
});
});
});

@@ -22,3 +22,3 @@ var nock = require('../.')

t.equal(ret.length, 1);
t.equal(ret[0].indexOf("\nnock('expensecat.iriscouch.com')\n .post('/', '\"ABCDEF\"')\n .reply("), 0);
t.equal(ret[0].indexOf("\nnock('expensecat.iriscouch.com')\n .post('/'\"ABCDEF\")\n .reply("), 0);
t.end();

@@ -25,0 +25,0 @@ });

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