Fork me on GitHub
#testing
<
2018-10-02
>
xiongtx17:10:19

Is there a way in clojure.test to perform tasks before / after all tests are run? Like the :once fixture, but for all tests instead of per-namespace. Use cases include checking that DB is connected, running migrations, etc.

seancorfield17:10:14

@xiongtx Not as far as I know. I've often wished for that (but I have a suspicion the lack of it is to discourage reliance of an entire test suite on environmental side effects -- by forcing you to consider setup & teardown for each group of tests independently).

xiongtx17:10:44

Hmm, I'm not sure what's the difference between side effects for a namespace versus a test suite. But thanks, that's what I thought. For now I'm treating the first alphabetical namespace as the place to run these setups.

seancorfield18:10:35

You know you shouldn't rely on test ordering, right @xiongtx? 🙂

😁 4