-
Notifications
You must be signed in to change notification settings - Fork 12k
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
How to debug jest tests? #27117
Comments
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list. You can find more details about the feature request process in our documentation. |
I think a command to just build the jest tests (ideally with a |
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends. Find more details about Angular's feature request process in our documentation. |
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage. We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package. You can find more details about the feature request process in our documentation. |
Command
test
Description
How does one debug jest tests?
Debugging a normal
jest
test run is documented here: https://jestjs.io/docs/troubleshooting#debugging-in-vs-code. It describes usingjest
with--runInBand
. However, there is no way to use--runInBand
withng test
:ng test --help
See also related issue: #25434.
Describe the solution you'd like
In my comment I suggest a way to run
ng build --test
(orng test --build
). It can run the build step before jest runs. This allows us to runjest --runInBand
ourselves.Another approach would be to add a
--runInBand
ng test flag for jest.Describe alternatives you've considered
I've currently invented a workaround. Unfortunately, without a proper
ng test --build
command, I had to revert tong test || exit 0
. This will build and run the tests once before debugging can start. The necessarysourceMapPathOverrides
are hideous as well 🙈launch.json
package.json
The text was updated successfully, but these errors were encountered: