mock-server / mockserver-client-node

MockServer javascript client for browsers, Node.js or any grunt build
http://mock-server.com
Apache License 2.0
72 stars 34 forks source link

verifySequenceById is not a function #126

Closed Zaporozhec7 closed 2 years ago

Zaporozhec7 commented 2 years ago

Describe the issue Calling client.verifySequenceById() throws an error verifySequenceById is not a function

What you are trying to do Trying to call client.verifySequenceById() method as it described in Typescript types - https://github.com/mock-server/mockserver-client-node/blob/7c5cd4a42a180efdd48326951dc80ea9172e5e00/mockServerClient.d.ts#L49

MockServer version 5.13.2

To Reproduce Steps to reproduce the issue:

I do not think it needs to reproduce, because it is obvious where is the error in the code. Here function verifySequenceById is not exported, as for example verifySequence is exported - https://github.com/mock-server/mockserver-client-node/blob/8d9326924a9e754b71e6608b0cb53887e7760ad1/mockServerClient.js#L826

Expected behaviour verifySequenceById to be callable because it exists and described in types

MockServer Log Not relevant

Zaporozhec7 commented 2 years ago

Pull request - https://github.com/mock-server/mockserver-client-node/pull/127

Zaporozhec7 commented 2 years ago

After exporting verifySequenceById (pull request above) I have other error:

incorrect verification sequence json format for:

      {\"expectationIds\":{}}

     schema validation errors:

      1 error:
       - $.expectationIds: object found, array expected

      OpenAPI Specification: https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/5.13.x
      Documentation: https://mock-server.com/mock_server/creating_expectations.html

I think the problem is here, because arguments is not really an array, and when stringified to JSON on sending, converted to object - https://github.com/mock-server/mockserver-client-node/blob/7c5cd4a42a180efdd48326951dc80ea9172e5e00/mockServerClient.js#L631

I have added one more commit to pull request to fix this - https://github.com/mock-server/mockserver-client-node/pull/127/commits/8a2903e2f885173c6dfcf7a1cd221ca166410bb5

Zaporozhec7 commented 2 years ago

Pull request is merged so should be fixed already