목차

kaocha

lambdaisland/kaocha is a comprehensive test runner that support unit testing and clojure.spec generative testing. Clojure and ClojureScript languages are supported.

watch

clj -M:test-kaocha --watch

bin/kaocha 파일 생성

#!/usr/bin/env bash
 
clojure -J-Xmx512m -M:test-kaocha -m kaocha.runner --config-file test/tests.edn "$@"

test/test/edn 파일 생성

#kaocha/v1 {}

deps.edn

:test/runner
  {:extra-paths ["test"]
   :extra-deps  {lambdaisland/kaocha {:mvn/version "1.0.700"}}
   :main-opts   ["-m" "kaocha.runner"]}

Running tests

With a deps.edn project with tests under the standaart test directory and using -test postfix on test names, then all that is required is the kaocha command

bin/kaocha

Plugins

Much of the functionality of Kaocha is provide by plugins

Profiling

Show the 3 slwest tests for each category of test, after the test results

As a command line option:

bin/kaocha --plugin kaocah.plugin/profiling

or added to the test.edn configuration

#kaocha/v1
{:plugins [:kaocha.plugin/profiling]}

Refs


관련 문서