Closed outcomes-timothy-huddle closed 4 years ago
Good eye. Thank you for bringing this up, and for such a detailed report!
PRs are welcome if you'd like to contribute, otherwise I'll have some pact time in about a week.
Thanks so much for this! After a false start, I've released 0.8.1, which works with your repro repo:
PASS src/test.js
Pact between test-consumer and test-provider
with 30000 ms timeout for Pact
it doesnt work with test runners other than jasmine
✓ should work (21 ms)
jest
provides a function that you can useper test file
to override the test timeout. It works across all test-runners, which is important, since right nowjest-pact
only works if you're using the jasmine runner.In
jest@26
they've added a new runner,jest-circus
, and inreact-scripts@4
that is the default testRunner, sojasmine
is no longer a thing. Injest@27
jest-circus
will be the default for jest period, and injest@28
you'll have to explicitly install the jasmine runner yourself to be able to use it.I am aware that currently
jest-pact
specifies a peer dependency of a very small subset ofjest
s, butreact-scripts@4
is coming, and it's bringingjest@26
&jest-circus
with it.package versions:
jest-pact: 0.7.0 @pact-foundation/pact: 9.11.1 jest: 26.4.0 (yes, I am aware this is outside the defined peerDependency range)
repro:
clone https://github.com/cah-timhuddle/jest-pact-bug-repro install the dependencies and run
npm test
you'll be able to see thejasmine is undefined