mockserver-client-node icon indicating copy to clipboard operation
mockserver-client-node copied to clipboard

MockServerClient.clearById typescript definition incorrect

Open forktrucka opened this issue 2 years ago • 0 comments

Describe the issue When using MockServerClient.clearById a rest api error is returned.

What you are trying to do clear an expectation by id

MockServer version 5.14.0

To Reproduce

  1. How you are running MockServer Docker

  2. Code you used to create expectations

const client = mockServerClient(mockServerHost, mockServerPort);
const value = await client.mockAnyResponse();
client.clearById({ id: value[0].id },"ALL");
  1. What error you saw

image

Expected behaviour The expectation is cleared. The typescript definition is expecting an object with an id. However if you check mockServerClient.js it is creating an object and nesting the passed in expectationid and incorrectly creating the request.

image

image

MockServer Log See above

forktrucka avatar Jan 04 '23 05:01 forktrucka