Run a namespace's tests over the live nREPL (the fast inner loop) or, when no nREPL is reachable, by shelling clojure -M:test (the suite gate).
The in-REPL path is FRAMEWORK-AGNOSTIC: a ns whose vars carry clojure.test :test metadata runs through clojure.test/run-tests; otherwise it is treated as lazytest and run through lazytest.runner/run-tests. Either way the result is a uniform STRING-keyed map (crosses the strings-only boundary) with "mode" (repl or cli), "framework", "ns", "total", "pass", "fail" and "failures" [{"ns" "test" "message" "file" "line"} ...].
run-form is the code EVALED on the target nREPL. It is a quoted form (not a call into this namespace) so it works against ANY project's nREPL, including hosts that do not have the vis extension on their classpath.
Run a namespace's tests over the live nREPL (the fast inner loop) or, when no
nREPL is reachable, by shelling clojure -M:test (the suite gate).
The in-REPL path is FRAMEWORK-AGNOSTIC: a ns whose vars carry clojure.test
:test metadata runs through clojure.test/run-tests; otherwise it is treated
as lazytest and run through lazytest.runner/run-tests. Either way the result
is a uniform STRING-keyed map (crosses the strings-only boundary) with
"mode" (repl or cli), "framework", "ns", "total", "pass", "fail" and
"failures" [{"ns" "test" "message" "file" "line"} ...].
run-form is the code EVALED on the target nREPL. It is a quoted form (not a
call into this namespace) so it works against ANY project's nREPL, including
hosts that do not have the vis extension on their classpath.(build-eval-code ns-strs sel)(build-eval-code ns-strs sel ns-files)Self-contained Clojure source string that runs tests for ns-strs with sel. ns-files optionally maps namespace strings to absolute .clj paths to load when the target nREPL does not have test paths on the classpath.
The printer vars are pinned (no length/level/meta/dup limits) so the emitted
code is always COMPLETE and readable — a caller runtime that caps
print-level / print-length would otherwise render deep sub-forms of
run-form as # / ... and produce an unreadable, unbalanced string.
Self-contained Clojure source string that runs tests for ns-strs with sel. ns-files optionally maps namespace strings to absolute .clj paths to load when the target nREPL does not have test paths on the classpath. The printer vars are pinned (no length/level/meta/dup limits) so the emitted code is always COMPLETE and readable — a caller runtime that caps *print-level* / *print-length* would otherwise render deep sub-forms of run-form as `#` / `...` and produce an unreadable, unbalanced string.
(clj-test-fn env arg)Run clojure tests. The arg may name namespaces directly (:ns) or point at directories/files via :paths / :path, which are walked for *_test.clj and resolved to namespaces. When NOTHING is requested (no :ns, no :paths) the whole workspace is scanned for *_test.clj and every test namespace runs — empty selectors mean 'run everything', not 'run nothing'. The one case that still errors is explicit-but-empty: a :paths was given yet no *_test.clj was found under them (a real 'nothing to run there', not a 'run all' intent). The nREPL boots at the tests' OWN project root — the nearest deps.edn / project.clj / bb.edn at or below the workspace root — so a NESTED project runs against its own build file instead of the workspace root's classpath. The result :mode says which path ran; :language is always clojure so the result is self-describing across the language / framework / tool / mode axes.
Run clojure tests. The arg may name namespaces directly (:ns) or point at directories/files via :paths / :path, which are walked for *_test.clj and resolved to namespaces. When NOTHING is requested (no :ns, no :paths) the whole workspace is scanned for *_test.clj and every test namespace runs — empty selectors mean 'run everything', not 'run nothing'. The one case that still errors is explicit-but-empty: a :paths was given yet no *_test.clj was found under them (a real 'nothing to run there', not a 'run all' intent). The nREPL boots at the tests' OWN project root — the nearest deps.edn / project.clj / bb.edn at or below the workspace root — so a NESTED project runs against its own build file instead of the workspace root's classpath. The result :mode says which path ran; :language is always clojure so the result is self-describing across the language / framework / tool / mode axes.
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 |