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 warning message when there are no tests #8595

Merged
merged 4 commits into from Jun 24, 2019
Merged

Fix warning message when there are no tests #8595

merged 4 commits into from Jun 24, 2019

Conversation

kaykayehnn
Copy link
Contributor

Summary

When running jest with '--passWithNoTests' but there are no tests to execute, it prints a superfluous warning. This PR removes this warning.

Description

In both screenshots below there are no test files and jest is executed with --passWithNoOptions.
It used to log that it exited with code 1 and a message to use --passWithNoOptions, while it exits with code 0 and the option is already provided.

Closes #8594

Before:
image

After:
image

@codecov-io
Copy link

codecov-io commented Jun 22, 2019

Codecov Report

Merging #8595 into master will decrease coverage by 0.02%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8595      +/-   ##
==========================================
- Coverage   63.24%   63.22%   -0.03%     
==========================================
  Files         272      272              
  Lines       11312    11316       +4     
  Branches     2761     2762       +1     
==========================================
  Hits         7154     7154              
- Misses       3541     3544       +3     
- Partials      617      618       +1
Impacted Files Coverage Δ
packages/jest-core/src/getNoTestFound.ts 33.33% <0%> (-9.53%) ⬇️
packages/jest-core/src/getNoTestFoundVerbose.ts 0% <0%> (ø) ⬆️
packages/jest-jasmine2/src/errorOnPrivate.ts 0% <0%> (ø) ⬆️
packages/jest-mock/src/index.ts 77.52% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f5a0e8...8af21c7. Read the comment docs.

Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Nice! Can you add a changelog entry and a small test?

@kaykayehnn
Copy link
Contributor Author

Sure! I added a changelog entry and some snapshot tests. While adding the tests I found a simpler way to fix the issue so I'll have to force push the new changes.

@SimenB SimenB merged commit 5d42d0a into jestjs:master Jun 24, 2019
@kaykayehnn kaykayehnn deleted the fix-pass-with-no-tests-warning branch June 24, 2019 12:22
@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 May 11, 2021
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.

Jest prints superfluous warning when ran with '--passWithNoTests' and there are no tests
5 participants