jakemcc / test-refresh

Refreshes and reruns clojure.tests in your project.
393 stars 28 forks source link

Add :watch-dirs option #58

Closed Jell closed 8 years ago

Jell commented 8 years ago

By default, test-refresh re-runs the test whenever a file in any of the source or resources directories changed. I have a use case where running my specs modifies resources, so the result is that the tests keep triggering themselves.

The proposed solution is to give an optional whitelist of folders to watch, so I can ignore changes in some of the resources folders.

jakemcc commented 8 years ago

Thanks for the PR. Going to merge and then tweak the sample.project.clj a bit. Thanks for updating that though.

In my testing it seems like I have to specify :watch-dirs ["src" "test"] in order to get my tests to be picked up and run. That surprised me a bit.

jakemcc commented 8 years ago

Released in version [com.jakemccrary/lein-test-refresh "0.16.0"]

Jell commented 8 years ago

Hum that is weird, I would expect to not filter on any dir given the docs http://clojure.github.io/tools.namespace/#clojure.tools.namespace.dir/scan

jakemcc commented 8 years ago

I should have been more specific, I was talking about the scenario where it is only :watch-dirs ["src"]. :watch-dirs missing works exactly how I'd expect (which is to say the old way).

Jell commented 8 years ago

ah! ok now I get it :)

Jell commented 8 years ago

thanks for the super fast response! :) Cheers