Bernard Baker
03/22/2022, 1:40 PMtest(`makes a request`, async () => {
jest.setTimeout(30000);
// Arrange
const expectedResult = `Hello World`;
await mockProvider.addInteraction({
state: `foo exists`,
uponReceiving: `a request to get foo`,
withRequest: {
method: `GET`,
path: `/foo`
},
willRespondWith: {
status: 200,
headers: {
"Content-Type": regex({
generate: `text/plain`,
matcher: `text/plain;?.*`
})
},
body: like(expectedResult)
}
});
const request = await <http://axios.post|axios.post>(
`${mockProvider.mockService.baseUrl}/foo`
);
console.log(request);
});
My Pact logs are:
I, [2022-03-22T13:37:53.003897 #348] INFO -- : Registered expected interaction GET /foo
W, [2022-03-22T13:38:22.980712 #348] WARN -- : Verifying - actual interactions do not match expected interactions.
Missing requests:
GET /foo
W, [2022-03-22T13:38:22.980965 #348] WARN -- : Missing requests:
GET /foo
I, [2022-03-22T13:38:23.015926 #348] INFO -- : Cleared interactions
Any ideas?? Do I need to expose a port on my container???Yousaf Nabi (pactflow.io)