Liking cljdoc? Tell your friends :D

code.test


+listeners+clj


-mainclj

(-main & args)

main entry point for leiningen

(task/-main)

main entry point for leiningen

(task/-main)
raw docstring

=>clj


allclj

(all & cks)

checker that allows and composition of checkers

(mapv (all even? #(< 3 %)) [1 2 3 4 5]) => [false false false true false]

checker that allows `and` composition of checkers

(mapv (all even? #(< 3 %))
      [1 2 3 4 5])
=> [false false false true false]
raw docstring

anyclj

(any & cks)

checker that allows or composition of checkers

(mapv (any even? 1) [1 2 3 4 5]) => [true true false true false]

checker that allows `or` composition of checkers

(mapv (any even? 1)
      [1 2 3 4 5])
=> [true true false true false]
raw docstring

anythingclj

(anything x)

a checker that returns true for any value

(anything nil) => true

(anything [:hello :world]) => true

a checker that returns true for any value

(anything nil) => true

(anything [:hello :world]) => true
raw docstring

approxclj

(approx v)
(approx v threshold)

checker that allows approximate verifications

((approx 1) 1.000001) => true

((approx 1) 1.1) => false

((approx 1 0.0000001) 1.001) => false

checker that allows approximate verifications

((approx 1) 1.000001) => true

((approx 1) 1.1) => false

((approx 1 0.0000001) 1.001) => false
raw docstring

capturecljmacro

(capture)
(capture checker)
(capture checker sym)

adds a form to capture test input

adds a form to capture test input
raw docstring

containsclj

(contains x & modifiers)

checker for maps and vectors

((contains {:a odd? :b even?}) {:a 1 :b 4}) => true

((contains {:a 1 :b even?}) {:a 2 :b 4}) => false

((contains [1 2 3]) [1 2 3 4]) => true

((contains [1 3]) [1 2 3 4]) => false

checker for maps and vectors

((contains {:a odd? :b even?}) {:a 1 :b 4})
=> true

((contains {:a 1 :b even?}) {:a 2 :b 4})
=> false

((contains [1 2 3]) [1 2 3 4])
=> true

((contains [1 3]) [1 2 3 4])
=> false
raw docstring

contains-incljmacro

(contains-in x)

shorthand for checking nested maps and vectors

((contains-in {:a {:b {:c odd?}}}) {:a {:b {:c 1 :d 2}}}) => true

((contains-in [odd? {:a {:b even?}}]) [3 {:a {:b 4 :c 5}}]) => true

shorthand for checking nested maps and vectors

((contains-in {:a {:b {:c odd?}}}) {:a {:b {:c 1 :d 2}}})
=> true

((contains-in [odd? {:a {:b even?}}]) [3 {:a {:b 4 :c 5}}])
=> true
raw docstring

exactlyclj

(exactly v)
(exactly v function)

checker that allows exact verifications

((exactly 1) 1) => true

((exactly Long) 1) => false

((exactly number?) 1) => false

checker that allows exact verifications

((exactly 1) 1) => true

((exactly Long) 1) => false

((exactly number?) 1) => false
raw docstring

factcljmacro

(fact desc & body)

top level macro for test definitions

top level macro for test definitions
raw docstring

fact:allcljmacro

(fact:all)
(fact:all ns)

returns all facts in namespace

returns all facts in namespace
raw docstring

fact:benchcljmacro

(fact:bench)
(fact:bench params & inputs)

runs a small micro bench for the current fact

runs a small micro bench for the current fact
raw docstring

fact:checkcljmacro

(fact:check inputs)

runs a check over a range of values

runs a check over a range of values
raw docstring

fact:compileclj

(fact:compile fpkg)
(fact:compile fpkg global)

recompiles fact with a different global

recompiles fact with a different global
raw docstring

fact:derivecljmacro

(fact:derive desc)

runs a form derived from a previous test

runs a form derived from a previous test
raw docstring

fact:execcljmacro

(fact:exec)
(fact:exec id)
(fact:exec ns id)

runs main hook for fact form

runs main hook for fact form
raw docstring

fact:getcljmacro

(fact:get)
(fact:get id)
(fact:get ns id)

gets elements of the current fact

gets elements of the current fact
raw docstring

fact:globalcljmacro

(fact:global)
(fact:global cmd & args)

fact global getter and setter

(fact:global)

fact global getter and setter

(fact:global)
raw docstring

fact:letcljmacro

(fact:let args)

runs a form that has binding substitutions

runs a form that has binding substitutions
raw docstring

fact:listclj

(fact:list)

lists all facts in namespace

lists all facts in namespace
raw docstring

fact:missingclj

(fact:missing)
(fact:missing ns)

returns all missing facts for a given namespace

returns all missing facts for a given namespace
raw docstring

fact:nscljmacro

(fact:ns & forms)

fact ns macro

fact ns macro
raw docstring

fact:ns-loadclj

(fact:ns-load ns)

loads a test namespace

loads a test namespace
raw docstring

fact:purgeclj

(fact:purge)

purges all facts in namespace

purges all facts in namespace
raw docstring

fact:removecljmacro

(fact:remove)

removes the current fact

removes the current fact
raw docstring

fact:rerunclj

(fact:rerun facts)
(fact:rerun facts filters)
(fact:rerun facts filters global)

reruns all facts along with filter and compile options

reruns all facts along with filter and compile options
raw docstring

fact:setupcljmacro

(fact:setup)

runs setup hook for current fact

runs setup hook for current fact
raw docstring

fact:setup?cljmacro

(fact:setup?)

checks if setup hook has been ran

checks if setup hook has been ran
raw docstring

fact:symbolcljmacro

(fact:symbol)

gets the current fact symbol

gets the current fact symbol
raw docstring

fact:tablecljmacro

(fact:table header & inputs)

runs a form with tabular value substitutions

runs a form with tabular value substitutions
raw docstring

fact:teardowncljmacro

(fact:teardown)

runs teardown hook for current fact

runs teardown hook for current fact
raw docstring

fact:templatecljmacro

(fact:template desc & body)

adds a template to the file

adds a template to the file
raw docstring

is-notclj

(is-not ck)
(is-not ck function)

checker that allows negative composition of checkers

(mapv (is-not even?) [1 2 3 4 5]) => [true false true false true]

checker that allows negative composition of checkers

(mapv (is-not even?)
      [1 2 3 4 5])
=> [true false true false true]
raw docstring

justclj

(just x & modifiers)

combination checker for both maps and vectors

((just {:a odd? :b even?}) {:a 1 :b 4}) => true

((just {:a 1 :b even?}) {:a 1 :b 2 :c 3}) => false

((just [1 2 3 4]) [1 2 3 4]) => true

((just [1 2 3]) [1 2 3 4]) => false

((just [3 2 4 1] :in-any-order) [1 2 3 4]) => true

combination checker for both maps and vectors

((just {:a odd? :b even?}) {:a 1 :b 4})
=> true

((just {:a 1 :b even?}) {:a 1 :b 2 :c 3})
=> false

((just [1 2 3 4]) [1 2 3 4])
=> true

((just [1 2 3]) [1 2 3 4])
=> false

((just [3 2 4 1] :in-any-order) [1 2 3 4])
=> true
raw docstring

just-incljmacro

(just-in x)

shorthand for exactly checking nested maps and vectors

((just-in {:a {:b {:c odd?}}}) {:a {:b {:c 1 :d 2}}}) => false

((just-in [odd? {:a {:b even?}}]) [3 {:a {:b 4}}])

((just-in [odd? {:a {:b even?}}]) [3 {:a {:b 4}}]) => true

shorthand for exactly checking nested maps and vectors

((just-in {:a {:b {:c odd?}}}) {:a {:b {:c 1 :d 2}}})
=> false

((just-in [odd? {:a {:b even?}}]) [3 {:a {:b 4}}])

((just-in [odd? {:a {:b even?}}]) [3 {:a {:b 4}}])
=> true
raw docstring

(print-options)
(print-options opts)

output options for test results

(task/print-options) => #{:disable :default :all :current :help}

(task/print-options :default) => #{:print-bulk :print-failure :print-thrown}

output options for test results

(task/print-options)
=> #{:disable :default :all :current :help}

(task/print-options :default)
=> #{:print-bulk :print-failure :print-thrown}
raw docstring

runclj

(run)
(run ns)
(run ns params)
(run ns params project)
(run ns params lookup project)

runs all tests

(task/run :list)

(task/run 'std.lib.foundation) ;; {:files 1, :thrown 0, :facts 8, :checks 18, :passed 18, :failed 0} => map?

runs all tests

(task/run :list)

(task/run 'std.lib.foundation)
;; {:files 1, :thrown 0, :facts 8, :checks 18, :passed 18, :failed 0}
=> map?
raw docstring

run-erroredclj

(run-errored)

runs only the tests that have errored

(task/run-errored)

runs only the tests that have errored

(task/run-errored)
raw docstring

run:currentclj

(run:current)
(run:current ns)
(run:current ns params)
(run:current ns params project)
(run:current ns params lookup project)

runs the current namespace

runs the current namespace
raw docstring

run:interruptclj

(run:interrupt)

run:loadclj

(run:load)
(run:load ns)
(run:load ns params)
(run:load ns params project)
(run:load ns params lookup project)

load test namespace

load test namespace
raw docstring

run:testclj

(run:test)
(run:test ns)
(run:test ns params)
(run:test ns params project)
(run:test ns params lookup project)

runs loaded tests

runs loaded tests
raw docstring

run:unloadclj

(run:unload)
(run:unload ns)
(run:unload ns params)
(run:unload ns params project)
(run:unload ns params lookup project)

unloads the test namespace

unloads the test namespace
raw docstring

satisfiesclj

(satisfies v)
(satisfies v function)

checker that allows loose verifications

((satisfies 1) 1) => true

((satisfies Long) 1) => true

((satisfies number?) 1) => true

((satisfies #{1 2 3}) 1) => true

((satisfies [1 2 3]) 1) => false

((satisfies number?) "e") => false

((satisfies #"hello") #"hello") => true

checker that allows loose verifications

((satisfies 1) 1) => true

((satisfies Long) 1) => true

((satisfies number?) 1) => true

((satisfies #{1 2 3}) 1) => true

((satisfies [1 2 3]) 1) => false

((satisfies number?) "e") => false

((satisfies #"hello") #"hello") => true
raw docstring

storesclj

(stores v)

a checker that looks into a ref object

((stores 1) (volatile! 1)) => true

((stores 1) 1) => false

a checker that looks into a ref object

((stores 1) (volatile! 1)) => true

((stores 1) 1) => false
raw docstring

throwsclj

(throws)
(throws e)
(throws e msg)

checker that determines if an exception has been thrown

((throws Exception "Hello There") (res/result {:status :exception :data (Exception. "Hello There")})) => true

checker that determines if an exception has been thrown

((throws Exception "Hello There")
 (res/result
  {:status :exception
   :data (Exception. "Hello There")}))
=> true
raw docstring

throws-infoclj

(throws-info)
(throws-info m)

checker that determines if an ex-info has been thrown

((throws-info {:a "hello" :b "there"}) (process/evaluate {:form '(throw (ex-info "hello" {:a "hello" :b "there"}))})) => true

checker that determines if an `ex-info` has been thrown

((throws-info {:a "hello" :b "there"})
 (process/evaluate {:form '(throw (ex-info "hello" {:a "hello" :b "there"}))}))
=> true
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close