Harris Lee
07/27/2022, 5:44 AMhas status code 200 (OK)
includes headers
"Content-Type" with value "application/json" (OK)
has a matching body (OK)
then failure
1.1) has a matching body
expected 'application/json;charset=utf-8' body but was 'application/json'
1.2) includes header 'Content-Type' with value 'application/json; charset=utf-8'
Expected header 'Content-Type' to have value 'application/json; charset=utf-8' but was 'application/json'
I am little bit confused. lol
consumer pact response and request headers are
"headers": {
"Content-Type": "application/json"
},
Matt (pactflow.io / pact-js / pact-go)
debug
and see if they help understand the issueMatt (pactflow.io / pact-js / pact-go)
Harris Lee
07/27/2022, 6:17 AMYou can change the log levels using the LOG_LEVEL environment variable.
Harris Lee
07/27/2022, 6:18 AMMatt (pactflow.io / pact-js / pact-go)
Harris Lee
07/27/2022, 6:25 AMlogLevel: "DEBUG",
Harris Lee
07/27/2022, 6:25 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
debug
Harris Lee
07/27/2022, 6:26 AMTypes of property 'logLevel' are incompatible.
Type 'string' is not assignable to type 'LogLevel'.
Harris Lee
07/27/2022, 6:26 AMMatt (pactflow.io / pact-js / pact-go)
Timothy Jones
07/27/2022, 7:19 AMType 'string' is not assignable to type 'LogLevel'.This is because LogLevel isn't a string, it's a type literal. You can address this with
logLevel: 'debug' as const
Timothy Jones
07/27/2022, 7:21 AMHarris Lee
07/28/2022, 12:03 AMoutgoing response: {"body":"{\"errors\":[{\"message\":\"Not found\",\"extensions\":{\"category\":\"notFound\",\"code\":\"NOT_FOUND\"},\"locations\":[{\"line\":2,\"column\":5}],\"path\":[\"deleteLink\"]}],\"data\":{\"deleteLink\":null}}"
do you know why pact generate
this message? is that becuz of empty body? I am not sure others, but it make me really confused lol
has a matching body
expected 'application/json;charset=utf-8' body but was 'application/json'
1.2) includes header 'Content-Type' with value 'application/json; charset=utf-8'
Matt (pactflow.io / pact-js / pact-go)
Harris Lee
07/28/2022, 12:15 AMDEBUG pact_verifier::provider_client] Received native response:
"content-type": "application/json"
Matt (pactflow.io / pact-js / pact-go)
Harris Lee
07/28/2022, 12:27 AM"headers": {
"Content-Type": "application/json"
}
Harris Lee
07/28/2022, 12:28 AMMatt (pactflow.io / pact-js / pact-go)
Harris Lee
07/28/2022, 12:29 AMTimothy Jones
07/28/2022, 12:39 AMMatt (pactflow.io / pact-js / pact-go)
content-type
header)Timothy Jones
07/28/2022, 12:40 AMHarris Lee
07/28/2022, 1:29 AMHarris Lee
07/28/2022, 1:29 AMHarris Lee
07/28/2022, 1:29 AMdebug
was really usefulMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Harris Lee
07/28/2022, 1:31 AMcontent-type
)was right , because I did not change provider to look at v3, it was look at v2 version but I did not knowHarris Lee
07/28/2022, 1:32 AMtest
and publish to pactflowHarris Lee
07/28/2022, 1:33 AMtest
and ran testHarris Lee
07/28/2022, 1:36 AMHarris Lee
07/28/2022, 1:38 AMconsumerVersionSelectors: [
{ tag: 'feature', latest: true }
I thought provider will look at my latest published pact but it was notHarris Lee
07/28/2022, 1:38 AMHarris Lee
07/28/2022, 1:38 AMtest
and find out provider was looking at wrong pact lolHarris Lee
07/28/2022, 1:40 AMMatt (pactflow.io / pact-js / pact-go)
Harris Lee
07/28/2022, 3:02 AM