GitHub
03/03/2023, 5:34 AMtrue or false.
I can define my interaction to be true with no problem:
willRespondWith: {
status: expectedStatus,
headers: {
'Content-Type': 'application/json'
},
body: true
}
I should be able to do the same thing with body: false, as the real life action happens:
screenshot 2018-12-13 at 14 43 08▾
willRespondWith body: false actually seems to return an empty string. From my console logs in my tests:
console.log src/domain/api/useCases/call.ts:80
true string -> response from the server as response.text()
console.log src/domain/api/useCases/call.ts:89
true 'boolean' -> what my method will return once it has managed the answer
console.log src/domain/api/useCases/call.ts:80
string -> response from the server as response.text(), empty string?
console.log src/domain/api/useCases/call.ts:89
{ code: '', message: '' } 'object' -> Should be `false 'boolean'`
Steps to reproduce
I am not sure this is a complicated issue, but if you need it I can do it.
Relevant log files
They are actually code files. I think the issue comes from here:
https://github.com/pact-foundation/pact-js/blob/master/src/dsl/interaction.ts#L110
and I think I am comforted in this idea by this issue and its resolution:
#177
pact-foundation/pact-jsGitHub
03/03/2023, 5:34 AM