New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

http-mockserver

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-mockserver - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

2

package.json
{
"name": "http-mockserver",
"description": "Testing made easy with mocked http servers",
"version": "1.1.4",
"version": "1.1.5",
"license": "MIT",

@@ -6,0 +6,0 @@ "scripts": {

@@ -8,3 +8,4 @@ const Q = require('q');

constructor (port, serverHost) {
constructor (port, serverHost, debugMode) {
this.debugMode = debugMode;
this.port = port;

@@ -76,2 +77,3 @@ this.serverHost = serverHost;

addRoute (options) {
this.log('Adding route', options);
return this.req({

@@ -102,5 +104,5 @@ uri: '/listener/' + this.port,

return request(options).spread((response, body) => {
return request(options).spread((response) => {
if (_.inRange(response.statusCode, 400, 600)) {
throw new Error(`Request failed: ${request.method} ${request.href} with status=${response.statusCode}, body=${body}`);
throw new Error(`Request failed: options=${JSON.stringify(options)}, response=${response.body}`);
}

@@ -110,4 +112,10 @@ return response;

}
log (...args) {
if (this.debugMode) {
console.log.apply(console, args);
}
}
}
module.exports = MockClient;
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