-
-
Notifications
You must be signed in to change notification settings - Fork 350
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
Jest Example errors related to async setup and teardown #385
Comments
Thanks @yosevukilonzo. I don't see anywhere where we use As for the wrapper code: beforeAll(done => {
provider.setup().then(() => done())
})
afterAll(done => {
provider.finalize().then(() => done())
}) Yes, I believe a PR to replace it with the following should work just fine, thanks for the offer:
|
Thanks for spotting this, @yosevukilonzo I'll wait for your PR so that you get proper credit in the commit history. You might also be interested in https://github.com/YOU54F/jest-pact , which we've been working on to make setting up Pact tests with Jest less fiddly. |
I don't know either now @mefellows, I must have seen it in an example somewhere else 🤷♂. Good to know that it is unnecessary with Cool @TimothyJones, I wasn't aware of jest-pact! |
We fixed this by accident when we migrated the jest example to use jest-pact a while back (which is neat, as avoiding this mistake is kind of the point of jest-pact). |
Software versions
Expected behaviour
There are no errors or warnings in the test output.
Actual behaviour
There are errors and warnings in the test output related to handling async code.
Steps to reproduce
There are errors using the example test setup code from https://github.com/pact-foundation/pact-js/blob/master/examples/jest/pactTestWrapper.js
Snippet 1
Error
Fix
Snippet 2
Warning
Could I update the Jest Examples to include promise examples like this:
The text was updated successfully, but these errors were encountered: