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

mockserver-client

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockserver-client - npm Package Compare versions

Comparing version 5.10.0 to 5.11.0

45

mockServerClient.js

@@ -357,5 +357,24 @@ /*

var mockAnyResponse = function (expectation) {
return makeRequest(host, port, "/expectation", addDefaultExpectationHeaders(expectation));
return makeRequest(host, port, "/mockserver/expectation", addDefaultExpectationHeaders(expectation));
};
/**
* Setup an expectation by specifying an OpenAPI expectation
* for example:
*
* client.openAPIExpectation(
* {
* "specUrlOrPayload": "https://raw.githubusercontent.com/mock-server/mockserver/master/mockserver-integration-testing/src/main/resources/org/mockserver/mock/openapi_petstore_example.json",
* "operationsAndResponses": {
* "showPetById": "200",
* "createPets": "500"
* }
* }
* );
*
* @param expectation the OpenAPI expectation to setup on the MockServer
*/
var openAPIExpectation = function (expectation) {
return makeRequest(host, port, "/mockserver/openapi", expectation);
};
/**
* Setup an expectation by specifying a request matcher, and

@@ -412,3 +431,3 @@ * a local request handler function. The request handler function receives each

webSocketClient.clientIdCallback(function (clientId) {
return makeRequest(host, port, "/expectation", createExpectationWithCallback(requestMatcher, clientId, times)).then(sucess, error);
return makeRequest(host, port, "/mockserver/expectation", createExpectationWithCallback(requestMatcher, clientId, times)).then(sucess, error);
});

@@ -458,3 +477,3 @@ }, error);

request.headers = headersUniqueConcatenate(request.headers, defaultRequestHeaders);
return makeRequest(host, port, "/verify", {
return makeRequest(host, port, "/mockserver/verify", {
"httpRequest": request,

@@ -515,3 +534,3 @@ "times": {

then: function (sucess, error) {
return makeRequest(host, port, "/verifySequence", {
return makeRequest(host, port, "/mockserver/verifySequence", {
"httpRequests": requestSequence

@@ -543,3 +562,3 @@ }).then(

var reset = function () {
return makeRequest(host, port, "/reset");
return makeRequest(host, port, "/mockserver/reset");
};

@@ -561,3 +580,3 @@ /**

}
return makeRequest(host, port, "/clear" + (type ? "?type=" + type : ""), addDefaultRequestMatcherHeaders(pathOrRequestMatcher));
return makeRequest(host, port, "/mockserver/clear" + (type ? "?type=" + type : ""), addDefaultRequestMatcherHeaders(pathOrRequestMatcher));
};

@@ -573,3 +592,3 @@ /**

}
return makeRequest(host, port, "/bind", {ports: ports});
return makeRequest(host, port, "/mockserver/bind", {ports: ports});
};

@@ -589,3 +608,3 @@ /**

then: function (sucess, error) {
makeRequest(host, port, "/retrieve?type=REQUESTS&format=JSON", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
makeRequest(host, port, "/mockserver/retrieve?type=REQUESTS&format=JSON", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
.then(function (result) {

@@ -610,3 +629,3 @@ sucess(result.body && JSON.parse(result.body));

then: function (sucess, error) {
makeRequest(host, port, "/retrieve?type=REQUEST_RESPONSES&format=JSON", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
makeRequest(host, port, "/mockserver/retrieve?type=REQUEST_RESPONSES&format=JSON", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
.then(function (result) {

@@ -633,3 +652,3 @@ sucess(result.body && JSON.parse(result.body));

then: function (sucess, error) {
return makeRequest(host, port, "/retrieve?type=ACTIVE_EXPECTATIONS&format=JSON", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
return makeRequest(host, port, "/mockserver/retrieve?type=ACTIVE_EXPECTATIONS&format=JSON", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
.then(function (result) {

@@ -656,3 +675,3 @@ sucess(result.body && JSON.parse(result.body));

then: function (sucess, error) {
return makeRequest(host, port, "/retrieve?type=RECORDED_EXPECTATIONS&format=JSON", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
return makeRequest(host, port, "/mockserver/retrieve?type=RECORDED_EXPECTATIONS&format=JSON", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
.then(function (result) {

@@ -678,3 +697,3 @@ sucess(result.body && JSON.parse(result.body));

then: function (sucess, error) {
return makeRequest(host, port, "/retrieve?type=LOGS", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
return makeRequest(host, port, "/mockserver/retrieve?type=LOGS", addDefaultRequestMatcherHeaders(pathOrRequestMatcher))
.then(function (result) {

@@ -687,3 +706,5 @@ sucess(result.body && result.body.split("------------------------------------"));

/* jshint -W003 */
var _this = {
openAPIExpectation: openAPIExpectation,
mockAnyResponse: mockAnyResponse,

@@ -690,0 +711,0 @@ mockWithCallback: mockWithCallback,

{
"name": "mockserver-client",
"description": "A node client for the MockServer",
"version": "5.10.0",
"version": "5.11.0",
"homepage": "http://mock-server.com",

@@ -45,3 +45,3 @@ "author": {

"karma-xvfb-chrome-launcher": "0.0.1",
"mockserver-node": "5.10.0",
"mockserver-node": "5.11.0",
"nodeunit": "^0.11.3"

@@ -55,2 +55,4 @@ },

"dependencies": {
"grunt-ts": "^6.0.0-beta.22",
"json-schema-to-typescript": "^9.1.0",
"q": "~2.0",

@@ -57,0 +59,0 @@ "websocket": "^1.0.30"

@@ -197,2 +197,3 @@ # mockserver-client-node

2020-03-24 | v5.10.0 | Upgrading MockServer to 5.10.0
2020-07-08 | v5.11.0 | Upgrading MockServer to 5.11.0

@@ -199,0 +200,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