Can't run test on Mocha 5.2 and Babel 6.26

88 Views Asked by At

In my package.json I have the following dependencies:

"mocha": "^5.2.x",
"babel-core": "^6.26.3",
"babel-loader": "^6.4.1",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-1": "^6.24.1"

When I try to run my tests with: ./node_modules/mocha/bin/mocha --require babel-polyfill --require babel-register --recursive ./tests/** I am getting the following error:

/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-core/lib/transformation/file/options/option-manager.js:328
        throw e;
        ^

Error: Options {"loose":true} passed to /Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-preset-env/lib/index.js which does not accept options. (While processing preset: "/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-preset-env/lib/index.js") (While processing preset: "/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-preset-env/lib/index.js") (While processing preset: "/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-preset-react/lib/index.js")
    at /Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-core/lib/transformation/file/options/option-manager.js:314:17
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at compile (/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-register/lib/node.js:103:45)
    at loader (/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Volumes/SourceRepos/central-ui/node_modules-Darwin/babel-register/lib/node.js:154:7)
    ...

I recently updated Mocha from version ^3.2.x. Tests were running without issues, with the same command, with Mocha 3.2. I use node.js 8.x LTS (that would be 8.13 at the writing of this post)

Any ideas how to fix this problem? Thanks.

0

There are 0 best solutions below