GitHub
03/08/2023, 1:24 PMimport { 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
TypeError: Cannot read property 'forEach' of undefined
at ../../node_modules/@pact-foundation/pact-core/src/verifier/validateOptions.ts:266:15
at Array.forEach (<anonymous>)
at ../../node_modules/@pact-foundation/pact-core/src/verifier/validateOptions.ts:265:18
at Array.forEach (<anonymous>)
at validateOptions (../../node_modules/@pact-foundation/pact-core/src/verifier/validateOptions.ts:260:5)
at new Verifier (../../node_modules/@pact-foundation/pact-core/src/verifier/index.ts:16:35)
at Object.<anonymous>.exports.default (../../node_modules/@pact-foundation/pact-core/src/verifier/index.ts:30:56)
at Pact.verifyPacts (../../node_modules/@pact-foundation/pact-core/src/pact.ts:158:27)
at ../../node_modules/@pact-foundation/src/dsl/verifier/verifier.ts:137:29
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.`
image▾
DEBUG and attach any relevant log files here (or link to a gist).
pact-foundation/pact-js-coreGitHub
03/09/2023, 11:05 PM