2022-12-28 15:21:15 +00:00
|
|
|
(ns test-helpers.component (:refer-clojure :exclude [test]))
|
|
|
|
|
|
|
|
(defmacro describe
|
|
|
|
[description & body]
|
|
|
|
`(js/global.describe
|
|
|
|
~description
|
|
|
|
(fn []
|
|
|
|
~@body
|
|
|
|
;; We need to return 'undefined', otherwise Jest gives a
|
|
|
|
;; warning: "Describe callback must not return a value".
|
|
|
|
js/undefined)))
|
|
|
|
|
|
|
|
(defmacro test
|
|
|
|
[description & body]
|
|
|
|
`(js/global.test
|
|
|
|
~description
|
|
|
|
(fn [] ~@body)))
|
2022-12-23 17:23:48 +00:00
|
|
|
|
|
|
|
(defmacro before-each
|
|
|
|
[description & body]
|
|
|
|
`(js/beforeEach
|
|
|
|
~description
|
|
|
|
(fn [] ~@body)))
|
|
|
|
|
|
|
|
(defmacro after-each
|
|
|
|
[description & body]
|
|
|
|
`(js/afterEach
|
|
|
|
~description
|
|
|
|
(fn [] ~@body)))
|