Не могу запустить тест на Мокке 5.2 и Бабеле 6.26 - PullRequest
0 голосов
/ 06 декабря 2018

В моем package.json у меня есть следующие зависимости:

"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"

Когда я пытаюсь запустить свои тесты с: ./node_modules/mocha/bin/mocha --require babel-polyfill --require babel-register --recursive ./tests/** Я получаю следующую ошибку:

/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)
    ...

Я недавно обновил Mocha с версии ^3.2.x.Тесты выполнялись без проблем, с той же командой, с Mocha 3.2.Я использую node.js 8.x LTS (это было бы 8,13 при написании этого поста)

Есть идеи, как решить эту проблему?Спасибо.

...