Liking cljdoc? Tell your friends :D

hara.test


-mainclj

(-main & args)

main entry point for leiningen

main entry point for leiningen
raw docstring

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

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-inclj/smacro

(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)

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

factclj/smacro

(fact & [desc? & body])

top level macro for test definitions

top level macro for test definitions
raw docstring

factsclj/smacro

(facts & more)

top level macro for test definitions

top level macro for test definitions
raw docstring

is-notclj

(is-not ck)

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-inclj/smacro

(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

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

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

output options for test results

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

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

process-argsclj

(process-args args)

processes input arguments

processes input arguments
raw docstring

runclj

(run)
(run project)
(run settings project)

run tests for entire project

(run) ;; ---- Project (zcaudate/hara:124) ---- ;; documentation.hara-api ;; documentation.hara-class ;; documentation.hara-common ;; documentation.hara-component ;; .... ;; .... ;; hara.time.data.vector-test ;; ;; Summary (99) ;; Files 99 ;; Facts 669 ;; Checks 1151 ;; Passed 1150 ;; Thrown 0 ;; ;; Failed (1)

(run {:test-paths ["test/hara"] :include ["^time"] :print #{:print-facts}}) => {:files 8, :thrown 0, :facts 54, :checks 127, :passed 127, :failed 0} ;; Fact [time_test.clj:9] - hara.time/representation? ;; Info "checks if an object implements the representation protocol" ;; Passed 2 of 2

;; Fact [time_test.clj:16] - hara.time/duration? ;; Info "checks if an object implements the duration protocol" ;; Passed 2 of 2

;; ...

run tests for entire project
       
(run)
;;  ---- Project (zcaudate/hara:124) ----
;;  documentation.hara-api
;;  documentation.hara-class
;;  documentation.hara-common
;;  documentation.hara-component
;;   ....
;;   ....
;;  hara.time.data.vector-test
;;
;;  Summary (99)
;;    Files  99
;;    Facts  669
;;   Checks  1151
;;   Passed  1150
;;   Thrown  0
;;
;;   Failed  (1)

(run {:test-paths ["test/hara"]
      :include    ["^time"]
      :print      #{:print-facts}})
=> {:files 8, :thrown 0, :facts 54, :checks 127, :passed 127, :failed 0}
;;   Fact  [time_test.clj:9] - hara.time/representation?
;;   Info  "checks if an object implements the representation protocol"
;; Passed  2 of 2

;;   Fact  [time_test.clj:16] - hara.time/duration?
;;   Info  "checks if an object implements the duration protocol"
;; Passed  2 of 2

;; ...
raw docstring

run-namespaceclj

(run-namespace)
(run-namespace ns)
(run-namespace ns project)
(run-namespace ns settings project)

run tests for namespace

(run-namespace 'hara.class.checks-test) => {:files 1, :thrown 0, :facts 5, :checks 9, :passed 9, :failed 0}

;; ---- Namespace (hara.class.checks-test) ---- ;; ;; Summary (1) ;; Files 1 ;; Facts 5 ;; Checks 9 ;; Passed 9 ;; Thrown 0 ;; ;; Success (9)

run tests for namespace

(run-namespace 'hara.class.checks-test)
=> {:files 1, :thrown 0, :facts 5, :checks 9, :passed 9, :failed 0}

;; ---- Namespace (hara.class.checks-test) ----
;;
;; Summary (1)
;;   Files  1
;;   Facts  5
;;  Checks  9
;;  Passed  9
;;  Thrown  0
;;
;; Success (9)
raw docstring

satisfiesclj

(satisfies v)

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

throwsclj

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

checker that determines if an exception has been thrown

((throws Exception "Hello There") (common/map->Result {:type :exception :data (Exception. "Hello There")})) => true

checker that determines if an exception has been thrown

((throws Exception "Hello There")
 (common/map->Result
  {:type :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"}) (common/evaluate '(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"})
 (common/evaluate '(throw (ex-info "hello" {:a "hello" :b "there"}))))
=> true
raw docstring

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

× close