Skip to content
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

Splitting up assertions in unit tests #2338

Open
Rahmon opened this issue Sep 2, 2021 · 0 comments
Open

Splitting up assertions in unit tests #2338

Rahmon opened this issue Sep 2, 2021 · 0 comments

Comments

@Rahmon
Copy link
Contributor

Rahmon commented Sep 2, 2021

Is your enhancement related to a problem? Please describe.

Describe the solution you'd like
Some unit tests are testing different cases in one method. For example, testGetDocuments tests retrieving documents, retrieving a document that doesn't exist, and passing an empty id to retrieve a document.

When this test doesn't pass, it's not clear exactly which case have failed:

1) ElasticPressTest\TestElasticsearch::testGetDocuments
Failed asserting that 2 matches expected 3.

So, we could try to split up assertions a little to have more focused tests.

Designs

Describe alternatives you've considered

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants