code.test.compile

+arrows+

=>

arrow?

added in 3.0

(arrow? obj)

checks if form is an arrow

create-fact

added in 3.0

(create-fact meta body)

creates a fact given meta and body

fact

macro

added in 3.0

(fact desc & body)

top level macro for test definitions

fact-allowed?

fact-eval

added in 3.0

(fact-eval {:keys [ns id], :as fpkg})

creates the forms in eval mode

fact-id

added in 3.0

(fact-id {:keys [id refer], :as m} desc)

creates an id from fact data

(fact-id {} “hello there”) => ’test-hello-there

fact-prepare-core

added in 3.0

(fact-prepare-core desc? body meta)

prepares fact for a core form

fact-prepare-meta

added in 3.0

(fact-prepare-meta id meta desc body)

parses and converts fact to symbols

(fact-prepare-meta ’test-hello {} “hello” ’(1 => 1))

fact-skip?

added in 3.0

(fact-skip? x)

checks if form should be skipped

(fact-skip? ’(fact:component)) => true

fact-thunk

added in 3.0

(fact-thunk {:keys [full], :as fpkg})

creates a thunk form

fact:all

macro

added in 3.0

(fact:all)(fact:all ns)

returns all facts in namespace

fact:compile

added in 3.0

(fact:compile fpkg meta)

recompiles fact with a different global

fact:exec

macro

added in 3.0

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

runs main hook for fact form

fact:get

macro

added in 3.0

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

gets elements of the current fact

fact:list

added in 3.0

(fact:list)

lists all facts in namespace

fact:missing

added in 3.0

(fact:missing)(fact:missing ns)

returns all missing facts for a given namespace

fact:purge

added in 3.0

(fact:purge)

purges all facts in namespace

fact:remove

macro

added in 3.0

(fact:remove)

removes the current fact

fact:setup

macro

added in 3.0

(fact:setup)

runs setup hook for current fact

fact:setup?

macro

added in 3.0

(fact:setup?)

checks if setup hook has been ran

fact:symbol

macro

added in 3.0

(fact:symbol)

gets the current fact symbol

fact:teardown

macro

added in 3.0

(fact:teardown)

runs teardown hook for current fact

fact:template

macro

added in 3.0

(fact:template desc & body)

adds a template to the file

install-fact

added in 3.0

(install-fact meta body)

installs the current fact. Warns loudly when a different fact with the same id is already installed in the namespace — the usual cause is two facts sharing one :refer (the id is derived from it), which silently overwrites the earlier fact so that it never runs while the suite stays green. Give one fact a unique :id in its metadata to disambiguate. Re-installing the same fact (same id and description, e.g. a REPL re-eval) replaces silently.

rewrite-top-level

added in 3.0

(rewrite-top-level body)(rewrite-top-level [x y z & more :as arr] out)

creates a sequence of pairs from a loose sequence (rewrite-top-level ’(def a 1) (+ a 3) => 5) (contains-in ’[{:type :form, :meta {:line 8, :column 12}, :form ’(def a 1)} {:type :test-equal, :meta {:line 9, :column 12}, :input {:form ’(+ a 3)}, :output {:form 5}}])