-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
🚀 Feature: Better error for --file
option with non-existent file
#4047
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
--file
option with non-existed file--file
option with non-existent file
Here's what the current version of Mocha, 10.2.0, prints:
That first 👍 that it'd be good to give a better error than "Error: Cannot find module '...'". |
Wasn't exactly sure if you wanted to keep the red |
Hmm, do we even need the call stacks in the first place? Here are what Jest and Vitest report:
I think that kind of "relevant options" output would be much more useful than a big call stack. What do you think? |
Good point, I don't think we need the call stack and I'm not sure a diagnostic output like Jest's or Vitest applies here. Currently I think the above clues in the user that they should specify a precise path, absolute or relative, which is how |
Makes sense. If folks have a need for the extra fancy output they can always file a followup issue, I think. Thanks! Accepting PRs! 🚀 |
#5086 ready for review 👀 |
Awesome thanks! We're almost at the point where we can start reviewing PRs. This one is high up on the list given that it's a bugfix and doesn't touch too many things. Thanks! |
If specify non-existed file with
--file
option, mocha throw expection.It should be handled like
--require
.The text was updated successfully, but these errors were encountered: