Released 2025-03-10.
thrown? and thrown-with-msg? to lazytest.experimental.interfaces.clojure-test. (See #18)splint from CI until Splint supports Clojure 1.10.Released 2024-11-26.
defexpect and expecting to lazytest.extensions.expectations. Reduce code generated by expectations/expect, pass metadata through all generated code to make line numbers match correctly.splint to CI.Released 2024-11-21.
around context macro is now called once for all children. (See #12.)Released 2024-11-19.
--dir flags: clojure -M:dev:test test/unit test/integration will look for tests in both test/unit and test/integration.docs/core.md and in the lazytest.core docstring.lazytest.core/defdescribe from :clojure-lsp/unused-public-var linter.(+ 1 1)
=> int?
is rewritten as (expect (int? (+ 1 1))).
lazytest.core/throws-with-msg? and lazytest.core/causes-with-msg? better errors when the class matches but the regex doesn't.:test metadata to :lazytest/test metadata. It's longer, but it no longer clashes with clojure.test's internals so you can run lazytest over clojure.test tests without them being marked as passing tests. (See #4.):output and :reporter: :output is from the CLI or from a caller of the lazytest.repl functions, and :reporter is the function created/referenced from :output.lazytest.filter/filter-tree and out of lazytest.main.Released 2024-10-21.
lazytest.extensions.expectations. Only ports over expect and related helpers.--md FILE is how to specify markdown files to parse and treat as Lazytest tests.Released 2024-10-15.
Wrote better documentation for lazytest.core, highlighting the primary vars and their use cases.
Added generic support for skipping test cases or suites with :skip metadata.
(describe "many cases"
  (it "will be skipped"
    {:skip true}
    (expect (= 1 2)))
  (it "will be ran"
    (expect (= 1 1))))
lazytest.runner/run-test-suite: For running a suite value instead of running a namespace or a var.lazytest.core/update-children: An intended-for-internal-use function useful in defining suites and test-cases.:skip metadata on suites and test-cases.lazytest.core/it and lazytest.core/expect-it return nil if within *context*.lazytest.experimental.interfaces.midje/fact no longer wraps it in a describe.lazytest.core/defdescribe ignores *context*, allowing it to be nested.Released 2024-10-09.
lazytest.core aliases to the readme.Released 2024-10-09.
clojure.test, Midje, QUnit, and xUnit. This allows for writing tests in a more comfortable API while still using Lazytest's machinery. See each namespace's docstring for further details.lazytest.core vars:
describe -> contextit -> specifyexpect -> should:lazytest/suite to :lazytest/ns-suite for namespace-defined suites.:type.Released 2024-10-03.
:lazytest/runs and :lazytest/nses) have :children, which can be other suites or test cases.given in favor of let.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))))
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.
master to main.Released 2024-09-20.
--watch cli flag will run under "Watch mode", which uses clj-reload to check for changes in local classpath, and then reruns the provided or default test suite. Includes --delay NUM which allows for changing the number of milliseconds between checking changes.Released 2024-08-28.
Released 2024-08-28.
defdescribe var into describe attr-map. Fixes --include and --exclude filtering on var metadata instead of attr-map.Released 2024-08-19.
-n, --namespace NS cli flag to specify namespaces that will be tested.-v, --var VAR cli flag to specify vars that will be tested.:test metadata on vars. Handles functions, test cases, and test suites, converting them to test suites or using them directly. They're treated in the reporter as test vars, using the defn's var. (See README.md for examples.)Released 2024-08-08.
--exclude and --include cli flags for metadata selection. --include works like ^:focus but is arbitrary metadata.--help output.Released 2024-06-26.
Released 2024-06-18.
:form -> :expected:result -> :actual:fail and :error into :fail. If reporters want to differentiate, they can by checking if :thrown is an ExpectationFailed. (See clojure-test reporter for an example.)(message, reason) constructor arity to ExpectationFailed to better match both AssertionError and ExceptionInfo.expect, rethrow with updated :message, instead of passing msg into each assert-expr like in clojure.test.expect, wrap in ExpectationFailed as :caught data.:messages are tracked.describe, it and expect-it.*color* dynamic var (set to lazytest.colorize system env, default to true) and make colorize? rely on it.focused prints if there's any focused tests.summary prints "Ran x test cases, N failures, Y errors".results prints failed and errored test cases, expected values, etc.dots prints . for passing test case, and F for failure. Namespaces wrap test cases in parentheses: (..F.) Includes focused, results, and summary.nested prints each suite and test case on a new line, and indents each suite. Includes focused, results, and summary.clojure-test attempts to mimic clojure.test's basic output.debug prints "Running X" and "Done with X" for all test sequences and print the direct result of all test cases.Released 2024-06-09.
Updated original code to use deps.edn, tools.build, and other modern tooling.
clojure.test-like api.lazytest.core).Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs | 
| ← | Move to previous article | 
| → | Move to next article | 
| Ctrl+/ | Jump to the search field |