This is inspired by Mocha's excellent documentation.
--dir, then every file in the file trees of all given directories are checked. Otherwise, all files within the test directory are checked.tools.namespace, the namespace of each .clj is extracted and required, which creates the necessary vars.defdescribe? Call the defdescribe-constructed function and use the result.suite? Resolve the var and use the result.:lazytest/test metadata that is either a suite (describe) or a test case (it)? Create a new suite with describe and set the :lazytest/test metadata as a child.:lazytest/test metadata that is a function? Create a new suite with describe, create a new test case with it, and then set the docstring for the test case to :lazytest/test metadata, and the body to calling the :lazytest/test metadata function.:lazytest/ns suite, and then groups all of the namespace suites into a :lazytest/run suite.--namespace, vars by --var, and all suites and test cases by --include or --exclude (with :focus being automatically included). These are prioritized as such:
--namespace narrows all namespaces to those that exactly match. The namespaces of --var vars are included as well. If --namespace is not provided, all namespaces are selected.--var narrows all vars from the selected namespaces. If --namespace is provided, all vars from those namespaces are selected as well. If --var is not provided, all vars are selected.--include or :focus metadata suites and tests cases and then removing all --exclude suites and test cases. If no suites or test cases have :focus metadata or --include hasn't been provided, then everything is selected. (To be clear, --exclude overrides :focus and --include.)around context functions, combine them with clojure.test/join-fixtures, and then execute the rest of the steps in a thunk wrapped in the combined around function.before context function.:children, restart from step 1 of the appropriate sequence.after context function.around context functions, combine them with clojure.test/join-fixtures, and then execute the rest of the steps in a thunk wrapped in the combined around function.before context function.before-each function (including from all parents), outermost first, in definition order.test-case-result.after-each function (including from all parents), innermost first, in definition order.after context function.System/exit, and the exit value is either 0 for no failures or 1 for any number of failures.The process is roughly the same as from the CLI, but with CLI-specific steps skipped.
lazytest.repl/run-tests, the specified namespace used as the required namespace.lazytest.repl/run-all-tests, all currently loaded are used (found with clojure.core/all-ns).lazytest.repl/run-test-var, the single var is used as the suite.:focus is considered when filtering.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 |