mocha-webpack
mocha-webpack copied to clipboard
--watch only watches files in test directory
Running [email protected]
and [email protected]
, using the --watch
option only seems to watch for changes in my /test
directory, but not when I make changes to files in other directories like /src
.
Here is the command I am running:
mocha-webpack --webpack-config build/webpack.test.config.js --require ./test/bootstrap.js test/**/*.spec.js
Modifying src/runner/TestRunner.js
from:
const watcher = chokidar.watch(this.entries, {
...
});
to:
const watcher = chokidar.watch('.', {
...
});
resolves this issue for me, but I'm not familiar enough with the inner workings of this project to know what the real issue is. Having chokidar watch all files in the CWD is definitely a brute force method to get this working. Could there be something with my configuration that is incorrect, or is anyone else experiencing the same issue?
This is happening to me as well, with a simpler: mocha-webpack \"test/**/*.spec.js\"
.
Same version of mocha-webpack and webpack, though. I don't remember this being a problem across the last year of using it; so it feels like a bug introduced either by the new beta changes or a change in the way Webpack 4 behaves with entires.
I am not sure if this is related, but I use the watch mode to fix failing tests. When I fix the source code, the testing reruns, but very cleverly bypasses the previously failed tests giving me an illusion I fixed everything. So you would want to also add every previously failing test as if it was changed every time.
Did anyone find a resolution to this issue? I'm using [email protected] and it seems to only be watching the test files. It will not re-run the tests if I change my source files.
Apparently no solution was found