testing

Testing tools, testing philosophy & methodology...
xiongtx 2018-10-02T17:47:19.000100Z

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.

seancorfield 2018-10-02T17:54:14.000100Z

@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).

xiongtx 2018-10-02T17:56:44.000100Z

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.

seancorfield 2018-10-02T18:43:35.000100Z

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

1😁