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

fix: correct message when no tests found and findRelatedTests passed #12487

Merged
merged 6 commits into from
Feb 24, 2022

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Feb 24, 2022

Summary

Fixes #12478.

I originally changed findRelatedTests to fail unless passWithNoTests was provided, but backed it out. Now I just fix the message to reflect the exit code.

I'm not sure about #5127 (review), though. At least for the mentioned findRelatedTests I do think it makes sense to fail now.

Test plan

Tests tweaked

@@ -17,7 +17,10 @@ describe('No tests are found', () => {
'/non/existing/path/',
]);

expect(stdout).toMatch('No tests found');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've expanded these assertions to include the exit code and the line about passWithNoTests

@SimenB SimenB merged commit d0d7dab into jestjs:main Feb 24, 2022
@SimenB SimenB deleted the correct-message-when-no-tests branch February 24, 2022 14:19
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: No tests found using --findRelatedTests always exits with code 0
2 participants