You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have triple checked, that there are no unhandled promises in my code
I have set my log level to debug and attached a log file showing the complete request/response cycle
For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem
Expected behaviour
I have defined a provider interaction like below. After executing that test and feeding the created PACT file into a stub server, I'd expect to get a successful response for any request in the form of /animals?id=<SOME_NUMBER>.
// Provider interaction in PACT Testawaitprovider.addInteraction({state: "there are animals",uponReceiving: "a request for a specific animal",withRequest: {path: "/animals",method: "GET",query: {id: term({generate: "123",matcher: "\\d+",}),},},willRespondWith: {status: 200,headers: {"Content-Type": "application/json",},body: {id: term({generate: "123",matcher: "\\d+",}),name: like("dog"),},},});// ...// Starting a stub serverimport{Stub}from"@pact-foundation/pact-node";constpactStub=newStub({pactUrls: pactFiles,port: 4000,logLevel: "debug"});awaitpactStub.start();
Actual behaviour
When the stub server boots, it will print the following error to the console
and any request to /animals?id=<SOME_NUMBER> with SOME_NUMBER !== 123 will yield a 500 response. I have found this issue and this seems to have been a problem in the past that has been fixed already. However, I was not able to get it running with the latest version of @pact-foundation/pact-node.
Software versions
Issue Checklist
Please confirm the following:
Expected behaviour
I have defined a provider interaction like below. After executing that test and feeding the created PACT file into a stub server, I'd expect to get a successful response for any request in the form of
/animals?id=<SOME_NUMBER>
.Actual behaviour
When the stub server boots, it will print the following error to the console
and any request to
/animals?id=<SOME_NUMBER>
with SOME_NUMBER !== 123 will yield a 500 response. I have found this issue and this seems to have been a problem in the past that has been fixed already. However, I was not able to get it running with the latest version of@pact-foundation/pact-node
.Steps to reproduce
I've uploaded a minimal reproducible example here: https://github.com/calvinbayer/pact-stub-server-repro
Relevant log files
pact_debug_log.txt
The text was updated successfully, but these errors were encountered: