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

A test with no assertions should fail? #115

Open
khru opened this issue Sep 25, 2023 · 5 comments
Open

A test with no assertions should fail? #115

khru opened this issue Sep 25, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@khru
Copy link
Member

khru commented Sep 25, 2023

Add a configuration that allow the user to say if a test has no assertions should fail.

image

@khru khru added the enhancement New feature or request label Sep 25, 2023
@Chemaclass
Copy link
Member

What about not fail but raise a note saying "no assertions found in this test"?

Actually, for the first iteration, we can simply go with the failing option, and revisit/improve if needed later.

@khru
Copy link
Member Author

khru commented Sep 25, 2023

To me it should be a configuration, while doing TDD I would never want a test that does not assert anything, and we are nor offering any code coverage metric, so for me a test with no assertion should be by default a test that fails, unless you can tell me a case in which this could be a problem

What about not fail but raise a note saying "no assertions found in this test"?

Actually, for the first iteration, we can simply go with the failing option, and revisit/improve if needed later.

@antonio-gg-dev
Copy link
Member

What does phpunit/jest?

@khru
Copy link
Member Author

khru commented Sep 25, 2023

Some fail, some don't

@antonio-gg-dev
Copy link
Member

I found this reading phpunit docs:

https://docs.phpunit.de/en/10.3/writing-tests-for-phpunit.html#incomplete-tests

imagen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants