Clojure/script async test utilities.
Add the following dependency to your project.clj or build.boot:
[dm3/asynctest "0.1.0"]
then require the namespace:
(require '[asynctest.core :as asynctest])
;; In cljs
(require-macros '[asynctest.core :as asynctest])
Using from tests, e.g. in my_tests.cljc
:
(ns my-tests
(:require [clojure.test :refer [deftest testing is]]
[asynctest.core :as at])
#? (:cljs (:require-macros [asynctest.core :as at])))
(deftest my-test
(at/async done
(let [p (async-operation-returns-promise)]
(at/yield
(is (= :expected-result @p))
(done)))))
Copyright © 2017 Vadim Platonov
Distributed under the MIT License.