-
Notifications
You must be signed in to change notification settings - Fork 53
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 test suite file names in failure output #10659
Comments
Hah, ignore me. I have so much console output (thinking of jestjs/jest#4156) that I forgot how Jest prints the failing test name at the top: |
That's what I thought happened but figured maybe with a catastrophic failure it wouldn't print. Nothing to see here then! 😅 |
I thought about this more and I still think the change would be helpful. What do you think? Here are the benefits I see:
|
I'm okay with all root-level Dunno if that's possible though. I'm cool with this idea regardless though, I can never think of what to name these things! |
I don't think a helper would be helpful because you'd have to pass it describe(showFile(__filename), ...); which is pointless. |
Oh shoot, duh, right. I didn’t think that one through 😓
|
Describe the problem and steps to reproduce it:
Trigger a test failure that happens on the event loop. In other words, one that won't produce a stack trace pointing back to the test file.
What happened?
You have no easy way to figure out which test file produced the error. Example:
What did you expect to happen?
You should be able to easily figure out which test file produced the error.
Anything else we should know?
We can totally do this now that Jest runs from NodeJS! We can start every test with
describe(__filename, ...)
which will produce errors like this:The text was updated successfully, but these errors were encountered: