-
Notifications
You must be signed in to change notification settings - Fork 293
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
Show all cases of a parameterized test without having to run the test suites first #930
Comments
this will be hard... before the test is run, all we have is static analysis, i.e. no interpretation of template-literal or any variable substitutions. Right now I can't think of a way to get the interpreted strings without running the tests... |
Well, ideally Otherwise a hacky solution could be to run the test files with a custom implementation for |
Yes, I think you start to see why we did not take that approach. 😉 We should not reinvent the wheel, especially when we are not sure our duplicate effort would be better than the original while diverging from the core competency of this extension... A workaround is to use a "describe" with static text surrounding the dynamic-titled tests, that way you can still trigger the tests without depending on the dynamic titles to be resolved. |
close this as currently there is no good alternative without reinventing the wheel. We can revisit if the situation changed. |
@szsoke you might be interested to know that we made some changes based on your concern regarding not being able to run parameterized tests before running the test suite first. The solution we implemented is to automatically fall back to its parent block. (see #959 ) While it doesn't fully resolve the test names before the run, it should improve the experience quite a bit. Feel free to give the v5 pre-release a spin, and let us know how it works for you. Thanks. |
Environment
vscode-jest version
: 5.0.0node -v
: 14.20.1npm -v
oryarn --version
: 7.24.2npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): [email protected]{ "watch": false, "onSave": "test-file", "onStartup": null }
Prerequisite
npm run test
ornode_modules/.bin/jest
) npm run testSteps to Reproduce
Expected Behavior
When I open Test Explorer
And no tests have run yet
Then I see five test cases for the parameterized test suite
Actual Behavior
When I open Test Explorer
And no tests have run yet
Then I only one test case for the parameterized test, named
test %d
When I run the parameterized test suite
Then the test cases become visible in Test Explorer
And they can be run individually
This behavior is not a problem for small tests but becomes quite a chore if the tests are long-running. Is it possible to discover the test cases of a parameterized test suite without running it first?
The text was updated successfully, but these errors were encountered: