-
-
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
[Bug]: passWithNoTests flag ignored for empty test files #15107
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Anyone have any thoughts on this? |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
Version
29.7.0
Steps to reproduce
npm i
Commands:
test:noargs
jest --verbose
test:cmd
jest --passWithNoTests --verbose
test:config
jest --config=jest.testconfig.js
test:showconfig
jest --config=jest.testconfig.js --showConfig
Expected behavior
The
passWithNoTests
flag should treat an empty file as having no tests and not throw an error.Actual behavior
All results are the same, regardless of whether I put the parameter on the command line, in a config file, or exclude it altogether.
No parameter
Parameter on command line
Parameter in config file
Additional context
I don't honestly know if this is a bug or deliberate behavior (in which this shouldn't be a bug report but rather a feature request) and I can't find out the answer. But I think it's a perfectly reasonable thing for a developer to create empty test files when adding a feature and fleshing them out later. And on a system where all test files are picked up automatically, this shouldn't fail.
The workaround is to add an empty test suite and a single test to it. But that seems clunky.
Environment
The text was updated successfully, but these errors were encountered: