You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@kaluza/mock-server

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kaluza/mock-server - npm Package Compare versions

Comparing version

to
0.6.0

7

dist/mockserver.js

@@ -59,2 +59,3 @@ "use strict";

Method["POST"] = "POST";
Method["PATCH"] = "PATCH";
})(Method || (Method = {}));

@@ -74,2 +75,5 @@ var MockServer = /** @class */ (function () {

};
MockServer.prototype.patch = function (path, response) {
return this.createEndpoint(Method.PATCH, path, response);
};
MockServer.prototype.start = function () {

@@ -142,2 +146,5 @@ return __awaiter(this, void 0, void 0, function () {

break;
case Method.PATCH:
_this.router.patch(path, middleware_1.recordCalls(endpoint.record.calls), endpoint.handler);
break;
}

@@ -144,0 +151,0 @@ });

2

package.json
{
"name": "@kaluza/mock-server",
"version": "0.5.0",
"version": "0.6.0",
"main": "dist/mockserver.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -59,2 +59,10 @@ # Node Mock Server

#### server.patch(path, response)
Registers a PATCH endpoint for the given path, returning an `EndpointRecord`.
* `path` is an [Express-compatible path](https://expressjs.com/en/4x/api.html#path-examples)
* `response` can be either an object, which will be returned as JSON, or an Express-compatible request handler. This lets you vary the response based on what's in the request.
If two endpoints are created on the same path, the most recently created one will take precedence.
#### server.reset()

@@ -61,0 +69,0 @@