You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.
II'm trying to configure webpack using mocha tests for nodejs project with mocha loader, but can not understand manual that you have here,
Can somebody describe step by step how to configure it
Thx
The text was updated successfully, but these errors were encountered:
I actually figured out you don't actually need this mocha loader, at all.
webpack should delete this loader and just paste a snippet for getting mocha working
here is my working code, based on the SO answer I linked above
//test-main.js//bootstrap mocha, as per: https://mochajs.org/#running-mocha-in-the-browserrequire("mocha")mocha.setup("bdd")//load up all test files following general advice from: https://stackoverflow.com/questions/32385219/mocha-tests-dont-run-with-webpack-and-mocha-loader{constfoundTestsRequire=require.context("..",true,/.*\.test\.js?$/)//console.log( `keys found = ${ foundTestsRequire.keys().length }` )for(constkeyoffoundTestsRequire.keys()){console.log(key)foundTestsRequire(key)}}//run testsmocha.run()
If you want a fully functional solution, look at this commit into my isomorphic xlib library: Novaleaf/xlib@c47696d
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey guys,
II'm trying to configure webpack using mocha tests for nodejs project with mocha loader, but can not understand manual that you have here,
Can somebody describe step by step how to configure it
Thx
The text was updated successfully, but these errors were encountered: