-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Mocha and Babel 7 register not found #10777
Comments
Hey @gear4s! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
You might need to pass mocha -r babel-plugin-require-context-hook/register -r @babel/register -r test/__fixtures/chai-plugins --recursive test/unitnpx envinfo --preset babel or # test/mocha.opts
-r babel-plugin-require-context-hook/register
-r @babel/register
-r test/__fixtures/chai-plugins
--recursive
--preset babel
test/unitnpx
envinfo
# and just call
mocha |
Thanks for replying @futagoza I now get the error that context hook register does not exist: I'm also using the test/mocha.opts |
Try these (just to debug, they wont let you use
If neither of these work, it's either a problem with mocha (most likely) or your node installation |
I got it working, thanks for pointing out mocha and node installation Issue was that mocha was in the global installed modules, and not part of dev dependencies. I've installed it into my project's dev deps and reinstalled node on nvm. Thanks a lot! |
@gear4s I am glad that your issue is resolved. |
Bug Report
Current Behavior
Mocha can't find module
✖ ERROR: Cannot find module '@babel/register'
Input Code
Expected behavior/code
Mocha should require @babel/register
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
babel.config.js
Environment
Additional context/Screenshots
Run with:
mocha -r @babel/register -r test/__fixtures/chai-plugins --recursive test/unitnpx envinfo --preset babel
The text was updated successfully, but these errors were encountered: