Mocha cannot read transpiled #babel/register code - node.js

I am trying to implement Mocha in a create-react-app created application. I changed the test script, now it is pointing to Mocha, and I compile using #babel/register "^7.0.0". My package.json is as follows.
{...
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "NODE_ENV=test mocha --require node_modules/.bin/#babel/register src/test/*.test.js",
"eject": "react-scripts eject"
},
...
"devDependencies": {
"#babel/core": "^7.1.6",
"#babel/plugin-transform-modules-commonjs": "^7.1.0",
"#babel/plugin-transform-react-jsx": "^7.1.6",
"#babel/preset-env": "^7.1.6",
"#babel/register": "^7.0.0",
"babel-preset-react-app-babel-7": "^4.0.2-0",
"chai": "^4.2.0",
"chai-enzyme": "^1.0.0-beta.1",
"cheerio": "^1.0.0-rc.2",
"enzyme": "^3.7.0",
"mocha": "^5.2.0"
}
}
I have a .babelrc file in my root folder, configured as follows:
{
"presets": [
"react-app"
],
"plugins": [
"#babel/plugin-transform-modules-commonjs"
]
}
When I run npm test for Javascript everything works fine and the file gets to Mocha ok. When I try to test React components I get the syntax error below, and it happens when in the svg node in when importing the default image in the create-react-app splash screen. He does not recognise the < character
I tried to change many series of configuration in my presets/plugins, using preset-env, using plugin-transform-jsx, using preset-react (instead of preset-react-app) I also tried to downgrade babel using es2015 but I had no success, always the same error.
I don't understand if there is a problem with babel/register not transpiling correctly (or not transpiling at all) or if I am missing something else in the configuration. Could anyone help?
Below the error I get, I think it's from Mocha:
/home/user_me/test-mocha/src/logo.svg:1
(function (exports, require, module, __filename, __dirname) { <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
^
SyntaxError: Unexpected token <
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Object.newLoader [as .js] (/home/alessandro/Development/test-mocha/node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/alessandro/Development/test-mocha/src/App.js:2:1)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module._compile (/home/alessandro/Development/test-mocha/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Object.newLoader [as .js] (/home/alessandro/Development/test-mocha/node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/alessandro/Development/test-mocha/src/test/App.test.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module._compile (/home/alessandro/Development/test-mocha/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Object.newLoader [as .js] (/home/alessandro/Development/test-mocha/node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at /home/alessandro/Development/test-mocha/node_modules/mocha/lib/mocha.js:250:27
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/home/alessandro/Development/test-mocha/node_modules/mocha/lib/mocha.js:247:14)
at Mocha.run (/home/alessandro/Development/test-mocha/node_modules/mocha/lib/mocha.js:576:10)
at Object.<anonymous> (/home/alessandro/Development/test-mocha/node_modules/mocha/bin/_mocha:637:18)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

The problem here it was I was importing an inline svg file in one of my jsx modules. Babel did not have any plugin to transpile svg, hence the "<" unexpected token. I get it to work adding the Babel inline svg plugin, and changing my .babelrc as follows.
{
"presets": [
"react-app"
],
"plugins": [
"#babel/plugin-transform-modules-commonjs",
"inline-react-svg"
]
}
And it worked.

Related

Feathersjs with tsconfig-path not working while running with ts-node-dev

"scripts": {
"dev": "ts-node-dev --no-notify -r tsconfig-paths/register src/index.ts",
},
Getting following error
[INFO] 12:12:54 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 4.9.4)
TypeError: Cannot read property 'getEnv' of undefined
at Function.<anonymous> (/home/lap068/lectures/ln-sso/node_modules/#feathersjs/configuration/src/index.ts:44:29)
at Function.configure (/home/lap068/lectures/ln-sso/node_modules/#feathersjs/feathers/lib/application.js:59:8)
at Object.<anonymous> (/home/lap068/lectures/ln-sso/src/app.ts:25:5)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Module._compile (/home/lap068/lectures/ln-sso/node_modules/source-map-support/source-map-support.js:568:25)
at Module.m._compile (/tmp/ts-node-dev-hook-9561096062855228.js:69:33)
at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at require.extensions..jsx.require.extensions..js (/tmp/ts-node-dev-hook-9561096062855228.js:114:20)
at require.extensions.<computed> (/tmp/ts-node-dev-hook-9561096062855228.js:71:20)
at Object.nodeDevHook [as .ts] (/home/lap068/lectures/ln-sso/node_modules/ts-node-dev/lib/hook.js:63:13)
[ERROR] 12:13:10 TypeError: Cannot read property 'getEnv' of undefined
(node:326169) UnhandledPromiseRejectionWarning: Error: The client is closed
at Commander._RedisClient_sendCommand (/home/lap068/lectures/ln-sso/node_modules/#redis/client/dist/lib/client/index.js:440:31)
at Commander.SELECT (/home/lap068/lectures/ln-sso/node_modules/#redis/client/dist/lib/client/index.js:216:99)
at Object.<anonymous> (/home/lap068/lectures/ln-sso/src/redis.ts:9:19)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Module._compile (/home/lap068/lectures/ln-sso/node_modules/source-map-support/source-map-support.js:568:25)
at Module.m._compile (/tmp/ts-node-dev-hook-9561096062855228.js:69:33)
at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at require.extensions..jsx.require.extensions..js (/tmp/ts-node-dev-hook-9561096062855228.js:114:20)
at require.extensions.<computed> (/tmp/ts-node-dev-hook-9561096062855228.js:71:20)
at Object.nodeDevHook [as .ts] (/home/lap068/lectures/ln-sso/node_modules/ts-node-dev/lib/hook.js:63:13)
I have tried https://medium.com/#fmoessle/typescript-paths-with-ts-node-ts-node-dev-and-jest-671deacf6428

electrode-server throwing hapi webpack error

I am trying run this app locally using the below run command, and I am getting errors with starting the electrode server. I am rather new to this so please let me know what information is necessary in order to diagnose my issue. Thank you in advance for any help.
Relevant Dependencies
"#walmart/electrode-ccm-client": "3.3.1",
"#walmart/electrode-quimby-client": "2.0.2",
"#walmart/electrode-ui-config": "3.8.2",
"#walmart/electrode-wml-app": "3.3.5",
"electrode-archetype-react-app": "6.5.4",
"hapi": "^17.0.0",
- Dev -
"#walmart/electrode-build-utils": "^1.1.0",
"electrode-archetype-react-app-dev": "6.5.4",
"webpack-bundle-analyzer": "^3.7.0"
Run command:
NODE_TLS_REJECT_UNAUTHORIZED=0 clap dev
Terminal output:
Starting Electrode webpack dev server
electrode-server caught an error while starting your server
failed registering your plugin 'webpackDevHapi' with module '"./dev-hapi.js"' from path: 'CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin'
message: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
Suggestion to resolve the issue:
Please double check and verify your plugin 'webpackDevHapi'.
If you have followed this resolution step and you are still seeing an
error, please file an issue on the electrode-server repository
git+https://github.com/electrode-io/electrode-server.git
Error: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
at Object.exports.assert (CWD/node_modules/electrode-server/node_modules/hoek/lib/index.js:740:11)
at Object.exports.apply (CWD/node_modules/electrode-server/node_modules/hapi/lib/schema.js:17:10)
at module.exports.internals.Server.internals.Plugin.register (CWD/node_modules/electrode-server/node_modules/hapi/lib/plugin.js:216:25)
at CWD/node_modules/electrode-server/lib/electrode-server.js:238:16
at CWD/node_modules/electrode-server/lib/electrode-server.js:237:29
From previous event:
at registerPlugins (CWD/node_modules/electrode-server/lib/electrode-server.js:234:20)
From previous event:
at startElectrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:294:6)
at CWD/node_modules/electrode-server/lib/electrode-server.js:365:14
From previous event:
at start (CWD/node_modules/electrode-server/lib/electrode-server.js:354:71)
at processImmediate (internal/timers.js:464:21)
From previous event:
at electrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:412:6)
at Object.<anonymous> (CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin/dev-server.js:23:3)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
Unhandled rejection Error: Invalid plugin options {
"__name": "webpackDevHapi",
"module": "./dev-hapi.js",
"requireFromPath": "CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin"
}
[1] "attributes" is required
at Object.exports.assert (CWD/node_modules/electrode-server/node_modules/hoek/lib/index.js:740:11)
at Object.exports.apply (CWD/node_modules/electrode-server/node_modules/hapi/lib/schema.js:17:10)
at module.exports.internals.Server.internals.Plugin.register (CWD/node_modules/electrode-server/node_modules/hapi/lib/plugin.js:216:25)
at CWD/node_modules/electrode-server/lib/electrode-server.js:238:16
at CWD/node_modules/electrode-server/lib/electrode-server.js:237:29
From previous event:
at registerPlugins (CWD/node_modules/electrode-server/lib/electrode-server.js:234:20)
From previous event:
at startElectrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:294:6)
at CWD/node_modules/electrode-server/lib/electrode-server.js:365:14
From previous event:
at start (CWD/node_modules/electrode-server/lib/electrode-server.js:354:71)
at processImmediate (internal/timers.js:464:21)
From previous event:
at electrodeServer (CWD/node_modules/electrode-server/lib/electrode-server.js:412:6)
at Object.<anonymous> (CWD/node_modules/electrode-archetype-react-app-dev/lib/dev-admin/dev-server.js:23:3)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47
Electrode webpack dev server exited code 0 - signal null

can you help? Error: Cannot find module 'react-dev-utils/WatchMissingNodeModulesPlugin'

Error: Cannot find module 'react-dev-utils/WatchMissingNodeModulesPlugin'
Require stack:
- C:\Users\stromboli\IdeaProjects\projects-ui\config\webpack.config.js
- C:\Users\stromboli\IdeaProjects\projects-ui\scripts\start.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1014:15)
at Function.Module._load (internal/modules/cjs/loader.js:884:27)
at Module.require (internal/modules/cjs/loader.js:1074:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\stromboli\IdeaProjects\projects-ui\config\webpack.config.js:18:39)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Module.require (internal/modules/cjs/loader.js:1074:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\stromboli\IdeaProjects\projects-ui\scripts\start.js:32:23)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\stromboli\\IdeaProjects\\projects-ui\\config\\webpack.config.js',
'C:\\Users\\stromboli\\IdeaProjects\\projects-ui\\scripts\\start.js'
]
}
No matter what I do localhost won't open and I get this error. The github solutions shown didn't work either, how can I fix it I'm about to go crazy.
npm ls react-dev-utils
`-- react-dev-utils#12.0.1
In your config find webpack.config.dev.js and remove the following:
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
module.exports = {
// ...
plugins: [
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebook/create-react-app/issues/186
new WatchMissingNodeModulesPlugin(paths.appNodeModules),
]
}

I am getting the error, Can not find the module './--require.js' using mocha

I am trying to write the unit test case using mocha and chai but I am getting the error:-Cannot find module './--require.js when I run the test case.
the script is:- "test": "mocha --require babel-core/register 'server/api/**/*.test.js'"
full error:-
D:\gitlab-to-azure\blik-app\node_modules\yargs\yargs.js:1163
else throw err
^
Error: Cannot find module './--require.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.getConstants (D:/gitlab-to-azure/blik-app/server/config/environment/index.js:12:16)
at Object.<anonymous> (D:/gitlab-to-azure/blik-app/server/app.js:20:25)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at loader (D:\gitlab-to-azure\blik-app\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (D:\gitlab-to-azure\blik-app\node_modules\babel-register\lib\node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (D:/gitlab-to-azure/blik-app/server/api/group/group.test.js:2:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at loader (D:\gitlab-to-azure\blik-app\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (D:\gitlab-to-azure\blik-app\node_modules\babel-register\lib\node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\mocha.js:334:36
at Array.forEach (<anonymous>)
at Mocha.loadFiles (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\mocha.js:331:14)
at Mocha.run (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\mocha.js:809:10)
at Object.exports.singleRun (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\cli\run-helpers.js:108:16)
at exports.runMocha (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\cli\run-helpers.js:142:13)
at Object.exports.handler.argv [as handler] (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\cli\run.js:292:3)
at Object.runCommand (D:\gitlab-to-azure\blik-app\node_modules\yargs\lib\command.js:242:26)
at Object.parseArgs [as _parseArgs] (D:\gitlab-to-azure\blik-app\node_modules\yargs\yargs.js:1087:28)
at Object.parse (D:\gitlab-to-azure\blik-app\node_modules\yargs\yargs.js:566:25)
at Object.exports.main (D:\gitlab-to-azure\blik-app\node_modules\mocha\lib\cli\cli.js:68:6)
at Object.<anonymous> (D:\gitlab-to-azure\blik-app\node_modules\mocha\bin\mocha:164:29)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)```
Folder Structure:-
server
api
groups
controller.js
model.js
groups.test.js
You would need to qualify for the full path for the mocha runner, you can try something like this
"test": "./node_modules/.bin/mocha --compilers js:#babel/register 'server/api/**/*.test.js'"

Requires Babel "^7.0.0-0", but was loaded with "6.26.3"

I cannot figure out why the error below is being thrown. I have followed babel's official migration guide to 7, all of my babel dependencies are the 7 equivalents and I get this error:
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If
you are sure you have a compatible version of #babel/core, it is likely that something in your build process is loading the wrong version.
Inspect the stack trace of this error to look for the first entry that doesn't mention "#babel/core" or "babel-core" to see what is calling
Babel.
at throwVersionError (/code/node_modules/#babel/helper-plugin-utils/lib/index.js:65:11)
at Object.assertVersion (/code/node_modules/#babel/helper-plugin-utils/lib/index.js:13:11)
at _default (/code/node_modules/#babel/plugin-proposal-object-rest-spread/lib/index.js:41:7)
at /code/node_modules/#babel/helper-plugin-utils/lib/index.js:19:12
at Function.memoisePluginContainer (/code/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:113:13)
at Function.normalisePlugin (/code/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:146:32)
at /code/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
at Array.map (<anonymous>)
at Function.normalisePlugins (/code/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/code/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at OptionManager.init (/code/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/code/node_modules/babel-register/lib/node.js:103:45)
at loader (/code/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .js] (/code/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/code/src/backend/test/test.js:66:3)
at Module._compile (module.js:652:30)
at Module._compile (/code/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (module.js:663:10)
at Object.newLoader (/code/node_modules/pirates/lib/index.js:88:7)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at /code/node_modules/mocha/lib/mocha.js:220:27
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/code/node_modules/mocha/lib/mocha.js:217:14)
at Mocha.run (/code/node_modules/mocha/lib/mocha.js:469:10)
at Object.<anonymous> (/code/node_modules/mocha/bin/_mocha:404:18)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
While the error says to look for non babel-core or #babel/core entries, there are lots of them and I guess the most obvious one is the pirates package which itself is a dependency of babel-register?!?
My dependencies:
...
"#babel/cli": "^7.0.0",
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-class-properties": "^7.0.0",
"#babel/plugin-proposal-decorators": "^7.0.0",
"#babel/plugin-proposal-do-expressions": "^7.0.0",
"#babel/plugin-proposal-export-default-from": "^7.0.0",
"#babel/plugin-proposal-export-namespace-from": "^7.0.0",
"#babel/plugin-proposal-function-bind": "^7.0.0",
"#babel/plugin-proposal-function-sent": "^7.0.0",
"#babel/plugin-proposal-json-strings": "^7.0.0",
"#babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
"#babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
"#babel/plugin-proposal-numeric-separator": "^7.0.0",
"#babel/plugin-proposal-object-rest-spread": "^7.0.0",
"#babel/plugin-proposal-optional-chaining": "^7.0.0",
"#babel/plugin-proposal-pipeline-operator": "^7.0.0",
"#babel/plugin-proposal-throw-expressions": "^7.0.0",
"#babel/plugin-syntax-dynamic-import": "^7.0.0",
"#babel/plugin-syntax-import-meta": "^7.0.0",
"#babel/plugin-transform-destructuring": "^7.0.0",
"#babel/plugin-transform-modules-commonjs": "^7.0.0",
"#babel/register": "^7.0.0",
"#babel/node": "^7.0.0",
...
and am running mocha with the --compilers js:#babel/register switch.

Resources