You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use the xunit-file reporter in conjunction with gulp-mocha, and that reporter blows up with the error "Error: Cannot find module 'mocha'"
However, because mocha just checks for the string'Cannot find module' it incorrectly logs that the reporter wasn't found and makes things take a bit longer to debug.
The text was updated successfully, but these errors were encountered:
You might consider running require.resolve() first - it will either return a string or throw, but if it throws the "Cannot find module...", then you know it's due to the exact thing you're trying to require not existing.
Although, I think the better solution is probably to not have any custom logic here at all. Treat all errors equally, including 'cannot find module'.
I am a bot that watches issues for inactivity.
This issue hasn't had any recent activity, and I'm labeling it stale. In 14 days, if there are no further comments or activity, I will close this issue.
Thanks for contributing to Mocha!
I was trying to use the xunit-file reporter in conjunction with gulp-mocha, and that reporter blows up with the error "Error: Cannot find module 'mocha'"
However, because mocha just checks for the string
'Cannot find module'
it incorrectly logs that the reporter wasn't found and makes things take a bit longer to debug.The text was updated successfully, but these errors were encountered: