-
-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error: connect ECONNREFUSED ::1:<port> using PactV3 and Jest #1398
Comments
set the host to |
It worked thanks! Previously I only updated the host to |
This fix works with
|
What have you passed into the |
Hello, here's the PactV3 constructor and debug logs
Also attaching the pact file (using pact specification v2)
|
You've redacted the log file, but I need to see the part where it starts the mock server - this seems to be missing. Additionally, if you have the code that goes with your test that would be helpful. It looks like your code is trying to connect to the server too early, but that could be a red herring. beforeAll(() => {
provider.addInteraction(interaction); // <- this is a promise, and it's not awaited. See the bug template for checking dangling promises
}); |
The code is same as in the ticket description (only change is in the host value) (same error is thrown with awaited addInteraction) For the reducted sections, I triple checked, it only contain the model specifcations. For mock server this line might be of use -
Let me try increasing the test timeout value |
Same error despite increasing jest timeout. Here the extended log
|
any chance you could create a minimal repro on github? I can test it on a few systems |
Looks like the issue was caused by the mock server not being initialized inside Below test runs without throwing the error -
It's there in the examples too https://github.com/pact-foundation/pact-js/blob/master/examples/v3/e2e/test/consumer.spec.js |
Yeah |
Software versions
Please provide at least OS and version of pact-js
Issue Checklist
Please confirm the following:
Expected behaviour
fill in here
Actual behaviour
Steps to reproduce
How can someone else reproduce this bug?
// jest.config.pact
// setup-jest
// test.pact
Relevant log files
Please ensure you set logging to
DEBUG
and attach any relevant log files here (or link to a gist).NA
The text was updated successfully, but these errors were encountered: