-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Question on provider.verify() in consumer test? #65
Comments
Thanks @MichaelSu1983, perhaps our documentation is not very clear on this. The Without it, you are registering expectations and creating a contract with those expectations in it, but you aren't sure if your code is actually a) calling the API(s) or b) sending the right data or c) using the data that is coming back. This is marginally better than pure documentation. |
Thanks @mefellows for the confirmation. Now I see. So one more thing, is the way I structure tests correct? should I return provider.verify() like the example, or leave "it('successfully verifies', () => provider.verify());" as separate test? or I can write it in one case "afterEach(() => provider.verify());"? |
It's a promise so you return it or explicitly complete it or you might not get the feedback if it passed or failed. In terms of where it should go, It's up to you really, and your style. It's probably nicer to have the |
I understand the confusion here. I think we need to explain it better in the example and the docs. |
In examples/e2e/test/consumer.spec.js, I find the below test.
Question: I don't understand what "provider.verify()" does? Is this mandatory to be included in a test? or I can remove it. After I remove it, I can still see log and pact file are generated and test is run as well.
I have a test like this:
The text was updated successfully, but these errors were encountered: