Cyrus Devnomad
09/28/2022, 9:38 PMTest failed for the following reasons:
Mock server failed with the following mismatches:
0) The following request was expected but not received:
Method: GET
Path: /health
Here is the code of my example:
https://github.com/cyrusdevnomad/jest-pact-example
The error is issued whenever I execute npm run test
What could be the reason why the mock server is not reached?
ThanksYousaf Nabi (pactflow.io)
client.getHealth()
it("Testing the GET call", async () => {
await client.getHealth().then((health: any) => {
expect(health).toEqual("up");
console.log(`health: response: ${health}`);
});
});
which I don't quite understand yet 🤷♂️ because it has a then chained off it. But it's late and that should get you generating a pact file at leastYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Cyrus Devnomad
09/29/2022, 6:41 AMYousaf Nabi (pactflow.io)