New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'forEach' of undefined #433
Comments
PR related: #432 |
Can you please re-test with the latest @ghsouza89? This should be fixed now. Thanks again for raising it. |
@mefellows here is the result after update the @pact-foundation/pact-core to 13.13.5 Before run I did the follow steps:
|
|
You can do |
This illustrates the problem. You need to bump the version of @pact-foundation/pact to the latest (and remove the other pact-core dependency, you don't need to depend on it directly). The latest is 11.0.2, although I believe this was fixed in 11.0.1. Apologies for not being clear about this the first time. |
worked @TimothyJones , thanks a lot for your support, let doc all those steps! |
Thank you for reporting a bug! We appreciate it very much. Issues are a big input into the priorities for Pact development
All italic text in this template is safe to remove before submitting
Thanks again!
Software versions
Please provide at least OS and version of pact-js
Issue Checklist
Please confirm the following:
Expected behaviour
Provider Verification passed sucessfully
Actual behaviour
TypeError: Cannot read property 'forEach' of undefined
Steps to reproduce
Run the provider file
`import { Verifier } from '@pact-foundation/pact';
import path from 'path';
describe('Pact Verification', () => {
jest.setTimeout(50000);
it('validates the expectations of dynamicApi Service', () => {
const opts = {
log: path.resolve(process.cwd(), 'logs', 'pact.log'),
LogLevel: 'debug',
providerBaseUrl: 'providerBaseUrl',
pactBrokerUrl: 'pactBrokerUrl',
pactBrokerToken: 'pactBrokerToken',
pactUrls: [
'pactUrls',
],
publishVerificationResult: true,
providerVersion: '2.0.0',
provider: 'provider',
tags: ['release'],
};
return new Verifier(opts).verifyProvider().then((output) => {
console.log('Pact Verification Complete!');
console.log(output);
});
});
});
`
Here is the output
`FAIL contract-testing apps/contract-testing/provider/dynamicApi.spec.ts
Pact Verification
× validates the expectations of dynamicApi Service (15 ms)
● Pact Verification › validates the expectations of dynamicApi Service
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 2.036 s, estimated 3 s
Ran all test suites matching /apps\contract-testing\provider\/i.`
For extra bonus points and internet karma, provide a repository, gist or reproducible code snippet so that we can test the problem.
We recommend forking the project and modifying a relevant example in the examples folder
Relevant log files
Please ensure you set logging to
DEBUG
and attach any relevant log files here (or link to a gist).The text was updated successfully, but these errors were encountered: