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

--watch should run on change of every file in tree #242

Closed
mcollina opened this issue Jan 27, 2012 · 5 comments
Closed

--watch should run on change of every file in tree #242

mcollina opened this issue Jan 27, 2012 · 5 comments

Comments

@mcollina
Copy link

Currently --watch just run itself after a change to a js in the current folder.

Why don't extend it to every file in the tree (excluding node_modules)?

@tj
Copy link
Contributor

tj commented Jan 27, 2012

I guess it could, but as a js testing framework it makes sense to me at least, though I suppose for some libs changing image fixtures or something would be nice. What's your use-case?

@mcollina
Copy link
Author

It's simple, running test manually disrupt my focus.
Maybe it's a rubyist thing, but I tend to write short and clearly separated
modules, thus leading to lots of files and tests, usually deep in a
directory tree.

When I change a file under lib, or even a test, I see in growl if
everything is good or not. It's much, much faster than switching back to
the shell to run the tests and check the output.

Really, it's a feature for the laziest developers :).

OT
As node caches the required files, I've seen you call delete require.cache[file]. However in this way you could not remove from the
cache the dependencies in the correct order, or could you? If you have file
A that depends on file B, you must reload B first, and then move to A.
I think it's better deleting all the file in the cache, and then requiring
them again.

@tj
Copy link
Contributor

tj commented Jan 27, 2012

it does watch every javascript file, but not images etc..

@mcollina
Copy link
Author

I've checked that, it doesn't work for me because I'm using coffeescript,
and the utils.files method doesn't use the global pattern, but only /.js$/.

Could you fix that?

@tj
Copy link
Contributor

tj commented Jan 28, 2012

oh yuck, yeah i'll fix it

@tj tj closed this as completed in 11ff9f0 Feb 3, 2012
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

2 participants