Sebastian Suarez
03/09/2022, 3:39 PMdescribe("Validate pact of identity", () => {
it("Validate pact of identity creation", () => {
let opts = {
providerBaseUrl: baseUrl.BASE_URL,
changeOrigin: true,
provider: "Create identity",
logLevel: "DEBUG",
pactUrls: [
path.resolve(
process.cwd(),
`./__tests__/contract/pacts/${identity_data.nameConsumerPactFile}-${identity_data.nameProviderPactFile}.json`
),
],
requestFilter: async (req, res, next) => {
req.headers["authorization"] = "Bearer UQiQPSG-MtD3mNHG0JZT2mqfBh1",
next()
},
consumerVersionTags: ["QA"],
providerVersionTags: ["QA"],
publishVerificationResult: false,
providerVersion: "1.0.0"
}
return new Verifier(opts).verifyProvider()
.then((res) => {
console.log('-------> here I need to get the response <-------', res);
}).catch((res) => {
console.log('Pact Verification FAIL!: Get identity ', res);
});
})
})
Yousaf Nabi (pactflow.io)
logLevel
to trace
See this PR for context .
Hope that helps 🤞Yousaf Nabi (pactflow.io)
pact-node@10.17.1: Created '/Users/saf/dev/pactoss/jest-pact-typescript/node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.81/pact/bin/pact-provider-verifier'
https://github.com/pact-foundation/pact-provider-verifier/blob/7d52ff479e9ba982db49b9e120f4c876a515de97/lib/pact/provider_verifier/cli/verify.rb#L118
[2022-03-09 17:30:14.098 +0000] WARN (31571 on Yousafs-MacBook-Pro.local): pact-node@10.17.1: Pact exited with code 1.
Error: Invalid log level 'trace'. Must be one of: debug, info, warn, error, fatal.
at ChildProcess.<anonymous> (/Users/saf/dev/pactoss/jest-pact-typescript/node_modules/@pact-foundation/pact-node/src/verifier.ts:275:58)
Sebastian Suarez
03/09/2022, 5:42 PMYousaf Nabi (pactflow.io)
trace
) which isn't being set, so those refs probably want changing to debug
as well.
It wouldn't be too hard to store the req/responses in an object and return them.
Would welcome a PR 😎 otherwise feel free to raise a feature request via the GitHub issues on https://github.com/pact-foundation/pact-js or via our public roadmap https://pact.canny.io/Sebastian Suarez
03/09/2022, 8:20 PM