Skip to content
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

support for --watch #80

Closed
mweststrate opened this issue Sep 6, 2016 · 8 comments
Closed

support for --watch #80

mweststrate opened this issue Sep 6, 2016 · 8 comments

Comments

@mweststrate
Copy link

The mocha option --watch currently doesn't seem to do anything. Could that be added? Besides that this is really great!

@inukshuk
Copy link
Collaborator

inukshuk commented Sep 6, 2016

I'm not in favor of passing --watch through to Mocha. Mocha is trying to get rid of the --watch option and with good reason I think.

@mweststrate
Copy link
Author

mweststrate commented Sep 6, 2016

for us it worked great so far, especially because it integrates very well with the mocha compiler options (as the process is kept alive), so if it could be added without too much effort would be appreciated, even though I understand mocha wants to move away from it :)

@jprichardson
Copy link
Owner

I'm against it as well for the same reason @inukshuk stated. It may be easy to add, but the maintenance burden may add a lot. Ultimately your decision @inukshuk.

@mweststrate
Copy link
Author

Personally I would prefer to see verbatim options passing for wrapper tools like these, which pass anything not relevant for wrapper to the tool itself. Eg. electron-mocha --report -- --watch --reporter X **/*.js. Which leaves the maintenance burden to mocha and the risk to the consumer, instead of making a decision on watch before mocha does. I can imagine that in practice this is a little bit more tricky as mocha is started from JS, so you would still need to parse options, but anyway, my 2 cents ;-).

@inukshuk
Copy link
Collaborator

inukshuk commented Sep 6, 2016

@mweststrate want to give it a try? I'm happy to merge a PR if just passing the parameter through to mocha works fine in both processes without any extra effort.

@mweststrate
Copy link
Author

Gonna give it a shot tomorrow

@mweststrate
Copy link
Author

I did a quick investigation, it seems that watch is not handled by the mocha library itself, but by the CLI tool around it see, instead of here. (surprisingly this also holds for features like compilers). This makes it impossible to cleanly reuse the functionality, so it makes sense to me that you don't want to support this scenario as it would indeed introduce additional maintenance.

Will search for another, less optimal, solution

@kontrollanten
Copy link

It's been some years since this was closed. I think it can be worth a new discussion whether this should be included in electron-mocha. mocha decided to keep watch since it's widely used and appreciated by the community.

How much would it take to implement this functionality in electron-mocha? If it's wanted I may put some time in doing a PoC for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants