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.2.0 to 0.2.1

3

lib/intercept.js

@@ -66,3 +66,4 @@ var path = require('path')

, paused
, next = [];
, next = []
, callnext;

@@ -69,0 +70,0 @@ requestBody = requestBodyBuffers.map(function(buffer) {

{ "name" : "nock"
, "description" : "HTTP Server mocking for Node.js"
, "tags" : ["Mock", "HTTP", "testing", "isolation"]
, "version" : "0.2.0"
, "version" : "0.2.1"
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com>"
, "contributors" :
[ "Roly Fentanes"
]
, "repository" :

@@ -7,0 +10,0 @@ { "type" : "git"

@@ -530,1 +530,40 @@ var nock = require('../.')

});
tap.test("chaining API", function(t) {
var scope = nock('http://chainchomp.com')
.get('/one')
.reply(200, 'first one')
.get('/two')
.reply(200, 'second one');
http.get({
host: 'chainchomp.com'
, path: '/one'
}, function(res) {
res.setEncoding('utf8');
t.equal(res.statusCode, 200, 'status should be ok');
res.on('data', function(data) {
t.equal(data, 'first one', 'should be equal to first reply');
});
res.on('end', function() {
http.get({
host: 'chainchomp.com'
, path: '/two'
}, function(res) {
res.setEncoding('utf8');
t.equal(res.statusCode, 200, 'status should be ok');
res.on('data', function(data) {
t.equal(data, 'second one', 'should be qual to second reply');
});
res.on('end', function() {
scope.done();
t.end();
});
});
});
});
});
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