Closed haf closed 8 years ago
Damn, that was a tricky one.
npm run test
NODE_ENV=dev mocha-webpack --webpack-config webpack-test.config.js --colors --require source-map-support/register ./test/unit/*.js
npm run test:watch
NODE_ENV=dev mocha-webpack --webpack-config webpack-test.config.js --colors --require source-map-support/register --watch ./test/unit/*.js
The difference between this two calls is the --watch
option. npm run test
fails cause of the --require
argument before the test entry. The cli arguments parser marks the test entry as a second file for the require option.
I'll try to fix this soon. As a workaround change the order of arguments:
mocha-webpack [entry] [options]
NODE_ENV=dev mocha-webpack ./test/unit/*.js --webpack-config webpack-test.config.js --colors --require source-map-support/register
@zinserjan Excellent finding. Nice work!
Fixed & released in 0.3.1.
I was getting the same error if I put the --watch
before my --webpack-config
option.
If I move the --watch
after, it works properly.
The right hand side runs all tests successfully. The left not so.
Repro: https://github.com/logary/logary-js/commit/5e2db69163d19fd794eda71545c37f3b2bfe1235
npm install && npm build && npm run test
versusnpm install && npm build && npm run test:watch
.Misc
Log:
webpack-test.config.js:
Versions