You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Otherwise the command npm run publish:pact won't work.
I think this command npm run start:graphql:server also invokes the first one npm run start:provider, right? In any case, to have both commands executed in 2 terminal instances (as the readme suggets), will have the 2nd failing on overlapping port 3001
Also I think it helps to specify that the PACT_BROKER_BASE_URL refers to the https://<DOMAIN-NAME>.pactflow.io/ at least for basic free accounts on path flow.
That being said, still the command: npm run test:provider
Fails with this error:
● Pact Verification › should validate the expectations of movie-consumer
listen EADDRINUSE: address already in use :::3001
3 |
4 | const port = '3001';
> 5 | const app = server.listen(port, () => console.log(`Listening on port ${port}...`));
| ^
6 |
7 | importData();
8 |
at Function.listen (node_modules/express/lib/application.js:635:24)
at Object.listen (provider/provider-contract.spec.js:5:20)
● Pact Verification › should validate the expectations of movie-consumer
And same for the second call: ``
● GraphQL example › When a query to list a single movie on /graphql is made › returns the correct response
TypeError: Cannot read properties of undefined (reading 'movie')
110 | test('returns the correct response', async () => {
111 | const response = await getMovieById(1);
> 112 | expect(response.movie).toEqual(EXPECTED_BODY);
| ^
113 | });
114 | });
115 | });
at Object.movie (graphql/consumer/graphql-client-contract.spec.js:112:23)
● GraphQL example › When a query to list a single movie on /graphql is made › returns the correct response
Pact verification failed - expected interactions did not match actual.
26 |
27 | // Verify the consumer expectations
> 28 | afterEach(() => provider.verify());
| ^
29 |
30 | describe('When a query to list all movies on /graphql is made', () => {
31 | beforeAll(() => {
at new VerificationError (node_modules/@pact-foundation/pact/src/errors/verificationError.js:21:42)
at Pact.Object.<anonymous>.Pact.verify (node_modules/@pact-foundation/src/httpPact/index.ts:215:13)
at Object.verify (graphql/consumer/graphql-client-contract.spec.js:28:28)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 passed, 2 total
Snapshots: 0 total
Time: 0.56 s, estimated 1 s
Ran all test suites matching /graphql\/consumer\/graphql-client-contract.spec.js/i.
I guess this is not expected, right?
Or maybe am I doing something wrong?
I am testing on local, using a MBA M1.
Out of curiosity, if I go on: http://localhost:3001/ I get: the error: Cannot GET /, is this a symptom of something not right?
Thanks,
Leonardo
The text was updated successfully, but these errors were encountered:
Hi @mdcruz,
Thank you for sharing this project and for your great book!
The documentation needs some updates:
Otherwise the command
npm run publish:pact
won't work.I think this command
npm run start:graphql:server
also invokes the first onenpm run start:provider
, right? In any case, to have both commands executed in 2 terminal instances (as the readme suggets), will have the 2nd failing on overlapping port 3001Please replace these variables:
With the actual names:
Also I think it helps to specify that the
PACT_BROKER_BASE_URL
refers to thehttps://<DOMAIN-NAME>.pactflow.io/
at least for basic free accounts on path flow.That being said, still the command:
npm run test:provider
Fails with this error:
And same for the second call: ``
I guess this is not expected, right?
Or maybe am I doing something wrong?
I am testing on local, using a MBA M1.
Out of curiosity, if I go on:
http://localhost:3001/
I get: the error:Cannot GET /
, is this a symptom of something not right?Thanks,
Leonardo
The text was updated successfully, but these errors were encountered: