Skip to content

v1.0.0

Compare
Choose a tag to compare
@NoahTheDuke NoahTheDuke released this 03 Oct 14:28
· 63 commits to main since this release

Released 2024-10-03.

Changes

  • Rewrite internals to use nested maps instead of nested sequences and functions. Suites (and :lazytest/runs and :lazytest/nses) have :children, which can be other suites or test cases.
  • Deprecated given in favor of let.
  • Changed primary branch from master to main.
  • Disconnected Github fork from original Lazytest repo.

Features

  • Add macros before and after, 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 a clojure.test fixture:
(describe "it works"
  {:context [(around [f]
               (binding [*foo* 100]
                 (f)))]}
  ...)
  • Add macros before-each and after-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 like clojure.test/use-fixture.