```yarn run v1.22.10
warning ../../../../../../package.json: No license field
$ jest --testPathPattern=./tests/pact/.*
PASS tests/pact/consumer.pact.test.ts (8.282s)
sports highlight
? should validate pact provider (13ms)
[2020-12-20T10:57:44.414Z] INFO: pact@9.13.0/21092 : Verifying provider
[2020-12-20T10:57:44.428Z] INFO: pact-node@10.11.0/21092 : Verifying Pacts.
[2020-12-20T10:57:44.430Z] INFO: pact-node@10.11.0/21092 : Verifying Pact Files
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 8.342s
Ran all test suites matching /.\/tests\/pact\/.*/i.
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
at Object.getCodec (node_modules/iconv-lite/lib/index.js:65:27)
at Object.getDecoder (node_modules/iconv-lite/lib/index.js:127:23)
at getDecoder (node_modules/raw-body/index.js:45:18)
at readStream (node_modules/raw-body/index.js:180:15)
at getRawBody (node_modules/raw-body/index.js:108:12)
[2020-12-20T10:57:51.519Z] WARN: pact-node@10.11.0/21092 : Pact exited with code 1.
(node:21092) UnhandledPromiseRejectionWarning: Error: opening connection to
http://xx.pactflow.io:443...
opened
starting SSL for
http://xx.pactflow.io:443...
SSL established
<- "GET / HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: [redacted]\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Sun, 20 Dec 2020 10:57:48 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 4213\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept\r\n"
-> "Server: Webmachine-Ruby/1.5.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.72.0\r\n"
-> "X-Pact-Broker-Git-Sha: d1e9ba77\r\n"
-> "X-Pactflow-Git-Sha: a5404d3b\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-Request-Id: 3a991879b5ae0798abe80983bd9de84f\r\n"
-> "\r\n"
reading 4213 bytes...
-> "{\"_links\":{\"self\":{\"href\":\"
https://xx.pactflow.io\",\"title\":\"Index\",\"templated\":false},\"pb:publish-pact\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/{provider}/consumer/{consumer}/version/{consumerApplicationVersion}\",\"title\":\"Publish a pact\",\"templated\":true},\"pb:latest-pact-versions\":{\"href\":\"
https://xx.pactflow.io/pacts/latest\",\"title\":\"Latest pact versions\",\"templated\":false},\"pb:tagged-pact-versions\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/{provider}/consumer/{consumer}/tag/{tag}\",\"title\":\"All versions of a pact for a given consumer, provider and consumer version tag\",\"templated\":false},\"pb:pacticipants\":{\"href\":\"
https://xx.pactflow.io/pacticipants\",\"title\":\"Pacticipants\",\"templated\":false},\"pb:pacticipant\":{\"href\":\"
https://xx.pactflow.io/pacticipants/{pacticipant}\",\"title\":\"Fetch pacticipant by name\",\"templated\":true},\"pb:latest-provider-pacts\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/{provider}/latest\",\"title\":\"Latest pacts by provider\",\"templated\":true},\"pb:latest-provider-pacts-with-tag\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/{provider}/latest/{tag}\",\"title\":\"Latest pacts for provider with the specified tag\",\"templated\":true},\"pb:provider-pacts-with-tag\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/{provider}/tag/{tag}\",\"title\":\"All pact versions for the provider with the specified consumer version tag\",\"templated\":true},\"pb:provider-pacts\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/{provider}\",\"title\":\"All pact versions for the specified provider\",\"templated\":true},\"pb:latest-version\":{\"href\":\"
https://xx.pactflow.io/pacticipants/{pacticipant}/latest-version\",\"title\":\"Latest pacticipant version\",\"templated\":true},\"pb:latest-tagged-version\":{\"href\":\"
https://xx.pactflow.io/pacticipants/{pacticipant}/latest-version/{tag}\",\"title\":\"Latest pacticipant version with the specified tag\",\"templated\":true},\"pb:webhooks\":{\"href\":\"
https://xx.pactflow.io/webhooks\",\"title\":\"Webhooks\",\"templated\":false},\"pb:webhook\":{\"href\":\"
https://xx.pactflow.io/webhooks/{uuid}\",\"title\":\"Webhook\",\"templated\":true},\"pb:integrations\":{\"href\":\"
https://xx.pactflow.io/integrations\",\"title\":\"Integrations\",\"templated\":false},\"pb:pacticipant-version-tag\":{\"href\":\"
https://xx.pactflow.io/pacticipants/{pacticipant}/versions/{version}/tags/{tag}\",\"title\":\"Get, create or delete a tag for a pacticipant version\",\"templated\":true},\"pb:metrics\":{\"href\":\"
https://xx.pactflow.io/metrics\",\"title\":\"Get Pact Broker metrics\"},\"pb:can-i-deploy-pacticipant-version-to-tag\":{\"href\":\"
https://xx.pactflow.io/can-i-deploy?pacticipant={pacticipant}\\u0026version={version}\\u0026to={tag}\",\"title\":\"Determine if an application can be safely deployed to an environment identified by the given tag\",\"templated\":true},\"pb:provider-pacts-for-verification\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/{provider}/for-verification\",\"title\":\"Pact versions to be verified for the specified provider\",\"templated\":true},\"beta:provider-pacts-for-verification\":{\"name\":\"beta\",\"href\":\"
https://xx.pactflow.io/pacts/provider/{provider}/for-verification\",\"title\":\"DEPRECATED - please use pb:provider-pacts-for-verification\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"
https://xx.pactflow.io/doc/{rel}?context=index\",\"templated\":true},{\"name\":\"beta\",\"href\":\"
https://xx.pactflow.io/doc/{rel}?context=index\",\"templated\":true}],\"pb:api-tokens\":{\"href\":\"
https://xx.pactflow.io/settings/tokens\",\"title\":\"API tokens\",\"templated\":false},\"pb:audit\":{\"href\":\"
https://xx.pactflow.io/audit\",\"title\":\"Audit trail\",\"templated\":false},\"pb:secrets\":{\"href\":\"
https://xx.pactflow.io/secrets\",\"title\":\"Secrets\",\"templated\":false},\"pf:admin-users\":{\"href\":\"
https://xx.pactflow.io/admin/users\",\"title\":\"Users\",\"templated\":false},\"pf:admin-teams\":{\"href\":\"
https://xx.pactflow.io/admin/teams\",\"title\":\"Teams\",\"templated\":false},\"pf:admin-system-accounts\":{\"href\":\"
https://xx.pactflow.io/admin/system-accounts\",\"title\":\"System accounts\",\"templated\":false},\"pf:admin-roles\":{\"href\":\"
https://xx.pactflow.io/admin/roles\",\"title\":\"Roles\",\"templated\":false},\"pf:admin-permissions\":{\"href\":\"
https://xx.pactflow.io/admin/permissions\",\"title\":\"Permissions\",\"templated\":false}}}"
read 4213 bytes
Conn keep-alive
INFO: Fetching pacts for producer from
https://xx.pactflow.io/ with the selection criteria:
opening connection to
http://xx.pactflow.io:443...
opened
starting SSL for
http://xx.pactflow.io:443...
SSL established
<- "POST /pacts/provider/producer/for-verification HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nAuthorization: [redacted]\r\n"
<- "{\"providerVersionTags\":[\"local\"]}"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Sun, 20 Dec 2020 10:57:49 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 801\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept\r\n"
-> "Server: Webmachine-Ruby/1.5.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.72.0\r\n"
-> "X-Pact-Broker-Git-Sha: d1e9ba77\r\n"
-> "X-Pactflow-Git-Sha: a5404d3b\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-Request-Id: 20441768fbf7621bb3cf486281d4f065\r\n"
-> "\r\n"
reading 801 bytes...
-> "{\"_embedded\":{\"pacts\":[{\"shortDescription\":\"latest\",\"verificationProperties\":{\"notices\":[{\"when\":\"before_verification\",\"text\":\"The pact at
https://xx.pactflow.io/pacts/provider/producer/consumer/consumer/pact-version/xx is being verified because it matches the following configured selection criterion: latest pact between a consumer and producer\"}]},\"_links\":{\"self\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/producer/consumer/consumer/pact-version/xx\",\"name\":\"Pact between consumer (1.0.0) and producer\"}}}]},\"_links\":{\"self\":{\"href\":\"
https://xx.pactflow.io/pacts/provider/producer/for-verification\",\"title\":\"Pacts to be verified\"}}}"
read 801 bytes
Conn keep-alive
INFO: Reading pact at
https://xx.pactflow.io/pacts/provider/producer/consumer/consumer/pact-version/xx
DEBUG: The pact at
https://xx.pactflow.io/pacts/provider/producer/consumer/consumer/pact-version/xx is being verified because it matches the following configured selection criterion: latest pact between a consumer and producer
Verifying a pact between consumer and producer
Get
with POST /graphql
returns a response which
DEBUG: Setting up provider state '' for consumer 'consumer' using provider state set up URL
http://localhost:50165/_pactSetup
I, [2020-12-20T10:57:51.365317 #21125] INFO -- request: POST
http://localhost:50165/_pactSetup
D, [2020-12-20T10:57:51.365368 #21125] DEBUG -- request: User-Agent: "Faraday v0.17.3"
Content-Type: "application/json"
I, [2020-12-20T10:57:51.400008 #21125] INFO -- response: Status 415
D, [2020-12-20T10:57:51.400057 #21125] DEBUG -- response: x-powered-by: "Express"
content-security-policy: "default-src 'none'"
x-content-type-options: "nosniff"
content-type: "text/html; charset=utf-8"
content-length: "529"
date: "Sun, 20 Dec 2020 10:57:51 GMT"
connection: "close"
has status code 200 (FAILED - 1)
DEBUG: Setting up provider state '' for consumer 'consumer' using provider state set up URL
http://localhost:50165/_pactSetup
I, [2020-12-20T10:57:51.400852 #21125] INFO -- request: POST
http://localhost:50165/_pactSetup
D, [2020-12-20T10:57:51.400913 #21125] DEBUG -- request: User-Agent: "Faraday v0.17.3"
Content-Type: "application/json"
I, [2020-12-20T10:57:51.403150 #21125] INFO -- response: Status 415
D, [2020-12-20T10:57:51.403190 #21125] DEBUG -- response: x-powered-by: "Express"
content-security-policy: "default-src 'none'"
x-content-type-options: "nosniff"
content-type: "text/html; charset=utf-8"
content-length: "529"
date: "Sun, 20 Dec 2020 10:57:51 GMT"
connection: "close"
has a matching body (FAILED - 2)
includes headers
DEBUG: Setting up provider state '' for consumer 'consumer' using provider state set up URL
http://localhost:50165/_pactSetup
I, [2020-12-20T10:57:51.404004 #21125] INFO -- request: POST
http://localhost:50165/_pactSetup
D, [2020-12-20T10:57:51.404036 #21125] DEBUG -- request: User-Agent: "Faraday v0.17.3"
Content-Type: "application/json"
I, [2020-12-20T10:57:51.405986 #21125] INFO -- response: Status 415
D, [2020-12-20T10:57:51.406029 #21125] DEBUG -- response: x-powered-by: "Express"
content-security-policy: "default-src 'none'"
x-content-type-options: "nosniff"
content-type: "text/html; charset=utf-8"
content-length: "529"
date: "Sun, 20 Dec 2020 10:57:51 GMT"
connection: "close"
"Content-Type" which matches /application\/json/ (FAILED - 3)```