speclj icon indicating copy to clipboard operation
speclj copied to clipboard

Public interface for clearing speclj state

Open awkay opened this issue 8 years ago • 1 comments

I'm wanting to use Speclj in clojurescript, and I'm also wanting to use figwheel to hot load tests and run them in the same browser (or a number of browser simultaneously, for that matter). Similar to what Bruce did in his Clojure West conference talk on figwheel.

I've written a sample project that accomplishes this (and it is as nice as I imagined); however, I'm having to manually clear the state of speclj so my tests don't accumulate (every time a cljs file reloads specs, I end up with the old set and a new copy of the reloaded ones).

It wasn't too hard to figure out, but it seems like this is a useful approach that others might want to take, and my test runner feels rather fragile in that I think I'm hacking the internals of speclj to make the running work properly.

I'd be glad to do the coding and documentation to make this a more officially supported thing in speclj, but I'd want to know if you have any suggestions on where/what to place in the code base as a public API for this.

See this section of my runner for details on what I'm doing. Lines 26 and 36/37 are the significant bits...not sure I need both of the latter two now that I think about it.

Tony

awkay avatar Aug 12 '15 16:08 awkay