You can configure dynamic vars from tests.edn
, these will be bound to the
given values during the complete loading and running of the tests.
Technically they are bound after the config step, so config
hooks will not
see the given values, while pre-load
up to post-run
will.
The :bindings
configuration key takes a map from var name to value.
Some suggestions of things you can do with this:
kaocha.stacktrace/*stacktrace-filters* []
disable filtering of
stacktraces, showing all stack frameskaocha.stacktrace/*stacktrace-stop-list* []
disable the shortening
of the stacktrace (by default stops printing when it sees "kaocha.ns")clojure.pprint/*print-right-margin* 120
Make pretty printing use longer
line lengthsclojure.test.check.clojure-test/*report-completion* false, clojure.test.check.clojure-test/*report-trials* false
Make test.check less noisy.#kaocha/v1
{:bindings {my.foo-test/*a-var* 456}}
(ns my.foo-test
(:require [clojure.test :refer :all]))
(def ^:dynamic *a-var* 123)
(deftest var-test
(is (= 456 *a-var*)))
When I run bin/kaocha
Then the output should contain:
1 tests, 1 assertions, 0 failures.
#kaocha/v1
{:bindings {kaocha.stacktrace/*stacktrace-filters* ["clojure.core"]}}
(ns my.erroring-test
(:require [clojure.test :refer :all]))
(deftest stacktrace-test
(is (throw (java.lang.Exception.))))
When I run bin/kaocha
Then the output should contain:
clojure.lang
clojure.core
#kaocha/v1
{:bindings {kaocha.stacktrace/*stacktrace-filters* []}}
(ns my.erroring-test
(:require [clojure.test :refer :all]))
(deftest stacktrace-test
(is (throw (java.lang.Exception.))))
When I run bin/kaocha
Then the output should contain:
clojure.core
#kaocha/v1
{:bindings {kaocha.stacktrace/*stacktrace-stop-list* ["kaocha.runner"]}}
(ns my.erroring-test
(:require [clojure.test :refer :all]))
(deftest stacktrace-test
(is (throw (java.lang.Exception.))))
When I run bin/kaocha
Then the output should contain:
(Rest of stacktrace elided)
kaocha.runner$
#kaocha/v1
{:bindings {kaocha.stacktrace/*stacktrace-filters* []
kaocha.stacktrace/*stacktrace-stop-list* []}}
(ns my.erroring-test
(:require [clojure.test :refer :all]))
(deftest stacktrace-test
(is (throw (java.lang.Exception.))))
When I run bin/kaocha
Then the output should contain:
kaocha.runner$
(Rest of stacktrace elided)
Can you improve this documentation? These fine people already did:
Ben Lovell & Arne BrasseurEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close