-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocha --watch #2444
Comments
are you getting error on $(find api -name '*-test.js') |
@govind999 the console does not show errors. |
same here fixed by change .jsx to .js |
you'd probably want Mocha's |
thank you very much for your tip @boneskull {
"test": "mocha --compilers js:babel-core/register --compilers jsx:babel-register"
} |
What are those @boneskull? Are you suggesting something like https://www.npmjs.com/package/watch-run |
Discussion in #1780 seems to have converged on Chokidar; there might be others in the items brought up by searching for GitHub issues, without open/closed restriction, that mention "watch" (or "watch module", "watch package" or "watch plugin"?). (There's also some points made there that we really need to fix the problems with the programmatic API to allow external watcher tools to use Mocha as efficiently as the builtin |
Thank you @ScottFreeCode
Couldn't agree with that more. I was trying to run test with
Which works just fine, however very slow. Reason? Babel!
Every time file changes mocha requires |
Thank you @boneskull Just a note : if you run mocha through gulp, here is the notation :
|
Try specifying --watch-extensions to mocha |
Thank you @mmc41. Specifying // in package.json
"scripts": {
...
"watch:test": "mocha -r ts-node/register --watch app/**/*.spec.ts --watch-extensions ts"
} |
When i run the tests with "--watch" flag and change a .jsx file in this path "./src/components/screens/Proposals/New.jsx" the tests aren't reload. But, if i change a test file (tests/unit/components/screens/Proposals/New.js) the tests are reload.
So, i try run pass a regular expression in the flag like "--watch .src/*/.jsx" . The console shows only the jsx files in "components/screens" level. So, i think that Mocha is not load correctly the subdirectories.
It is my test command:
NODE_PATH=./src mocha --require test/unit/.setup.js --compilers js:babel-register --recursive test/unit
The text was updated successfully, but these errors were encountered: