Solved: Mocha 6, Webpack 4, Cyclic dependencies Errors
FullStackAlex opened this issue · 3 comments
FullStackAlex commented
Hey guys,
that's how I've got Mocha work in my project using Mocha 6, Webpack 4 and Toposort 2 (Cyclic dependency error):
I've just added all the latest versions in the package.json and deleted package-lock.json and node_modules and run again:
npm install
Since then I've got Mocha finally work!! No need for forks!
Here are my devDependencies in the package.json:
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.5.5",
"@babel/preset-env": "^7.3.4",
"@babel/runtime": "^7.5.5",
"@vue/cli-plugin-unit-mocha": "^3.9.0",
"@vue/test-utils": "1.0.0-beta.29",
"babel-loader": "^8.0.6",
"babel-plugin-transform-es2015-arrow-functions": "^6.22.0",
"babel-preset-env": "^1.7.0",
"browserslist": "^4.4.2",
"chai": "^4.2.0",
"clean-webpack-plugin": "^2.0.0",
"copy-webpack-plugin": "^5.0.0",
"css-loader": "^2.1.1",
"express-static": "^1.2.6",
"file-loader": "^3.0.1",
"html-webpack-plugin": "^3.2.0",
"jsdom": "^15.1.1",
"jsdom-global": "^3.0.2",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"mocha": "^6.2.0",
"mocha-webpack": "^2.0.0-beta.0",
"nyc": "^14.1.1",
"preload-webpack-plugin": "^3.0.0-beta.3",
"puppeteer": "^1.19.0",
"sinon": "^7.3.2",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"vue": "^2.6.8",
"vue-loader": "^15.7.0",
"vue-router": "^3.0.2",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.10",
"vuex": "^3.1.0",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.1",
"webpack-merge": "^4.2.1",
"webpack-node-externals": "^1.7.2"
},
sirber commented
npm WARN mocha-webpack@2.0.0-beta.0 requires a peer of mocha@>=4 <=5 but none was installed.
FullStackAlex commented
yes, it's just a warning. Testing still works without any issues. At least in my case
fatso83 commented
If this is solved, why not close it?