GitHub
03/09/2023, 7:50 AMINFO tokio-runtime-worker pact_mock_server::hyper_server: Request matched, sending response HTTP Response ( status: 200, headers: None, body: Missing )
Steps to reproduce
new PactV4({
consumer: 'c',
provider: 'p',
}).addInteraction()
.given('given', {})
.uponReceiving('a request')
.withRequest('GET', '/path', (builder) => {})
.willRespondWith(200, (builder) => {
builder.jsonBody({ some_body: {} });
})
.executeTest((mockServer) => axios.get(`${mockServer.url}/path`).then(({ data })=> {
assert(data, 'body is missing');
}));
Notes
I think the issue is here:
this line ignores the builder.
A workaround to make it work is, to register a plugin.
Because then this line is being used
pact-foundation/pact-jsGitHub
03/09/2023, 11:37 AM