mocha-phantomjs icon indicating copy to clipboard operation
mocha-phantomjs copied to clipboard

Watch file changes

Open FrederikNJS opened this issue 12 years ago • 4 comments

I would love a feature to run mocha-phantomjs in watch-mode, such that it automatically runs all the tests when I save a file.

Mocha has this functionality built in with the -w parameter, but of course this does not work with mocha tests in a html harness.

FrederikNJS avatar Nov 21 '12 12:11 FrederikNJS

I think that falls outside of the domain of this even tho mocha does have that feature. I think most people will find that Cakefile's or using Grunt would suffice better and be able to accomplish much more. For instance, I was going to write a html5 sortable plugin and wrote up this grunt.js file to watch my files and do what I needed. In my case, run cake test:all. Check out my project here for some hints and ideas.

https://github.com/metaskills/html5_sortable

metaskills avatar Nov 22 '12 01:11 metaskills

+1 Would be nice to have, sometimes you just want to quick spin up tests without having to dig into build scripts.

danielepiccone avatar Sep 17 '15 11:09 danielepiccone

I can see that. One thing to note is that mocha-phantomjs can't know about what files you need to watch, but the same thing is true for browser sync that I've been using a lot lately, and I just pass it a glob of files to watch.

nathanboktae avatar Sep 17 '15 16:09 nathanboktae

+1

silentcloud avatar Apr 19 '16 02:04 silentcloud