v1.0.0
Released 2024-10-03
.
Changes
- Rewrite internals to use nested maps instead of nested sequences and functions. Suites (and
:lazytest/run
s and:lazytest/ns
es) have:children
, which can be other suites or test cases. - Deprecated
given
in favor oflet
. - Changed primary branch from
master
tomain
. - Disconnected Github fork from original Lazytest repo.
Features
- Add macros
before
andafter
, and support:context
in suite metadata. This allows for writing fixture-like code that can be reused across multiple suites or tests:
(defdescribe context-test
(let [state (volatile! [])]
(describe "it runs both"
{:context [(before (vswap! state conj :before))
(after (vswap! state conj :after))]}
(expect-it "temp" true))
(expect-it "tracks correctly"
(= [:before :after] @state))))
- Add the macro
around
, which works like aclojure.test
fixture:
(describe "it works"
{:context [(around [f]
(binding [*foo* 100]
(f)))]}
...)
- Add macros
before-each
andafter-each
, which are run before/after each nested test case. - Add function
set-ns-context!
which sets the current namespace's context to be the given vector. Works likeclojure.test/use-fixture
.