-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Accepting some test failures as success #7688
Comments
Unlike Many times, I've worked on defects fixing a bug and then realizing that I fixed another one. If I had put the test in |
It can be implemented in userspace, so once you do it and prove it's useful for more developers out there, we can consider adding it to the core :). Other than that you can still write expectations that are meant to fail. |
I think it's a great idea, and would love to see it in jest. See #4627 |
Oh my, I somehow missed or didn't remember that 😅 |
I was searching the issues for this but could not find it. Glad I'm not the only one who thought about this and interestingly enough we choose the same way to accomplish this. I'll monitor the other issue now. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Add the ability to mark a test ok to fail:
test.failing (name, fn, timeout)
test.failing.each (table) (name, fn, timeout)
test.failing.only (name, fn, timeout)
test.failing.only.each (table) (name, fn, timeout)
test.failing.skip (name, fn, timeout)
test.failing.skip.each (name, fn, timeout)
Motivation
When you write tests, you want to run them all the time. With the current jest behavior, you get a successful run when all tests are passing which is great. However, sometime you may end up writing tests that will fail until a defect is fixed or a feature is implemented. In real life, you would ensure the test would pass, but in practice you want the test to be present but be marked as
ok to fail
until you actually fix/implement it.Example
If a test is marked this way and it is failing, then jest will not return an error code. This is accepted.
If a test is marked this way and it is passing, then jest will return an error code as it is now passing and the
failing
option should be removed if this is expected (ideal situation) or the reason of the success should be investigated.Pitch
Let's you write way more tests at the beginning without having them passing and being notified as soon as they are passing. At this point you should check why they are passing.
Overall, it makes jest a better regression testing tool as regression does not mean tests should always pass, but it means that failed tests should continue to fail unless fix/feature was implemented.
The text was updated successfully, but these errors were encountered: