Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zt-hock

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zt-hock - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

2

lib/hock.js

@@ -337,3 +337,3 @@ const Request = require('./request');

}
res.writeHead(500, { 'Content-Type': 'text/plain' });
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end('No Matching Response!\n');

@@ -340,0 +340,0 @@ }

@@ -1,1 +0,43 @@

{"name":"zt-hock","description":"A mocking server for HTTP requests, forked from Hock","version":"0.2.0","author":"Joachim Seminck <joachim@seminck.be>","contributors":[{"name":"Joachim Seminck","email":"joachim@seminck.be"}],"repository":{"type":"git","url":"http://github.com/zeroturnaround/zt-hock.git"},"keywords":["mock","http","test"],"devDependencies":{"babel-eslint":"^7.2.3","eslint":"^4.0.0","eslint-config-zt":"^1.4.0","jest":"19.0.0","request":"^2.81.0"},"main":"./lib/hock","scripts":{"test":"jest","lint":"eslint ."},"dependencies":{"coveralls":"^3.0.0","deep-equal":"0.2.1"},"jest":{"roots":["test"],"testRegex":"-test.js","collectCoverage":true}}
{
"name": "zt-hock",
"description": "A mocking server for HTTP requests, forked from Hock",
"version": "0.3.0",
"author": "Joachim Seminck <joachim@seminck.be>",
"contributors": [
{
"name": "Joachim Seminck",
"email": "joachim@seminck.be"
}
],
"repository": {
"type": "git",
"url": "http://github.com/zeroturnaround/zt-hock.git"
},
"keywords": [
"mock",
"http",
"test"
],
"devDependencies": {
"babel-eslint": "^7.2.3",
"eslint": "^4.0.0",
"eslint-config-zt": "^1.4.0",
"jest": "19.0.0",
"request": "^2.81.0"
},
"main": "./lib/hock",
"scripts": {
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"deep-equal": "0.2.1"
},
"jest": {
"roots": [
"test"
],
"testRegex": "-test.js",
"collectCoverage": true
}
}

@@ -413,2 +413,28 @@ const request = require('request');

});
describe("when throwOnUnmatched is set to false", function() {
beforeEach(function(done) {
this.port = createPort();
this.hockInstance = hock.createHock({throwOnUnmatched: false});
this.httpServer = createHttpServer(this.hockInstance, this.port, done);
});
afterEach(function(done) {
this.httpServer.close(done);
});
it('should correctly respond to a missing request', function(done) {
catchErrors(done, () => {
request('http://localhost:' + this.port + '/notUrl',
(err, res, body) => {
expect(err).toBeFalsy();
expect(res).not.toBe(undefined);
expect(res.headers['content-type']).toEqual("text/plain");
expect(res.statusCode).toEqual(404);
expect(body).toEqual("No Matching Response!\n");
done();
});
});
});
});
});

Sorry, the diff of this file is not supported yet

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