slagyr / speclj

pronounced "speckle": a TDD/BDD framework for Clojure.
MIT License
458 stars 58 forks source link

Public interface for clearing speclj state #139

Open awkay opened 9 years ago

awkay commented 9 years ago

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

ghost commented 8 years ago

I'm assuming "no" is the answer, give the issue remains open, but has there been any progress on this front? I'm running speclj via the browser using some stuff listed here https://gist.github.com/mike-thompson-day8/8a87349cf69697bfcd64 . But, as mentioned, it seems like speclj holds on to some previously run tests. Run 2 tests (reload) Run 4 tests (reload) Run 6 tests etc.