-
-
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
--watch and --recursive command line parameters not executing tests correctly on Windows #2327
Comments
@WaffleSouffle what if you run mocha with less options, eg only |
This appears to be a Windows only bug. |
As with #2330, I'd suggest using a purpose-built tool for watching. Mocha's built-in "watch" functionality is limited. Such functionality really deserves something which can support multiple platforms and edge cases. |
@dasilvacontin Did you confirm this? |
@boneskull No, I don't have a Windows setup. |
Just tried to reproduce this on Windows and was unable to do so. I will double-check the tutorial and see if there might be something I missed. |
...Yeah, I'm not seeing anything different that should affect this. My test doesn't have Chai and stuff, but that shouldn't matter... right?... I've got this on Windows 8.1, same directory structure, same command, Mocha installed globally... |
I am having the same issue. I do not have this issue on Mac setup. |
I also have such issue on windows. |
For those having issues, please try passing a glob instead of the # quotes are necessary
mocha "tests/**/*.js" --watch UPDATE: Those may need to be backslashes? Try both. Enclosing the globspec in double-quotes means that the |
Any PR here should not grossly add to the level of complexity |
@boneskull I've tried the workarounds you suggested both with slashes and backslashes with and without recursive flag and double/single quotes. None of that did help |
@WaffleSouffle @jnields @dobryanskyy Could you please prepare a minimal setup that demonstrates this issue? 🤔 I think this would greatly help to pinpoint the root cause. 🤓 |
@dobryanskyy adding to what @gurdiga wrote, please keep it minimal unless you can provide the entire thing. also using "Babel" or "bundling" is a relevant detail; please include those |
@boneskull yes, I'm using babel for jsx and es6 transpilation. |
I also have problem!
But may be this small tip could be usefull: if run the same from |
Windows 7, mocha 3.4.2, cmder
upd: Git shell (from Github Desktop) don`t working. |
I am a bot that watches issues for inactivity. |
not stale |
having the same problem, on osx this is my command line for running mocha:
if I touch the first file: if I touch any of the I've also tried with |
@usulpro you use a symlink? I have this problem when using symlink
|
Hi @DonGiulio, try adding @higimo Could you elaborate on your code's structure and how to create a symlink that will encounter this? I was under the impression that symlinks are treated the same both times, but I'd be interested to take a look at it. (And just to double-check I'm on the same page: Is this on Windows? With cmd, or another shell?) |
Thanks @ScottFreeCode the
|
I don't think this is actionable. |
Adding --watch-extensions ts works for me too (on osx, visual studio code) 👍 mocha -r ts-node/register test/**/*.ts --reporter mochawesome --reporter-options reportDir=TestResults --watch --watch-extensions ts |
Setup
Tested with node 6.2.2 (https://nodejs.org/dist/v6.2.2/node-v6.2.2-x64.msi)
and current master build (v7.0.0-pre) built with MinGW 64 compiler
on Windows 8.1
npm install mocha -g
installs mocha 2.5.3 with warningsGoing through walkthrough https://www.codementor.io/nodejs/tutorial/unit-testing-nodejs-tdd-mocha-sinon
Same results executing in a DOS prompt, or a MinGW64 console.
Steps
Running
mocha tests --recursive --watch --colors
where tests is a root level directory containing tests.Correctly runs tests initially.
Then edit a test file to introduce non-breaking change.
Output appends
Any subsequent edits go ignored.
Expected Behaviour
Changes to test files to trigger execution.
Subsequent edits to be noticed.
The text was updated successfully, but these errors were encountered: