Replies: 1 comment 1 reply
-
Well, are you using an absolute |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to setup contract tests for my react application.
For this I'm trying to send api calls using the
enpoint.initiate()
way. After that, I test theaction
.I have the pact mock ready. It simulates the backend.
I also have the test code ready.
First time it ran, it failed saying I need to pass a custom fetchFn for SSR.
I've tried importing isomorphic-fetch, node-fetch, cross-fetch in my setup file for jest.
But now it either says
Only absolute URLs supported
orERRCONNREFUSED: 127.0.0.1:80
.I don't know why it's trying to reach port 80. I have the app configured to hit port 7000 for API.
The applications works when I run it in the browser and hits the API.
I don't know what I am missing here. Any suggestions?
More on pact: https://docs.pact.io/
I thought setting tests would be fun and easy. Why is it so difficult to send HTTP requests in jest tests? 😭
Beta Was this translation helpful? Give feedback.
All reactions