Created
November 27, 2017 22:20
-
-
Save augustl/00e62fd50a7651d889b13d2ac80924e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns huffda.expectations-basics-test | |
(:require [clojure.test :refer [deftest testing is async]] | |
[huffda.expectations :as expec] | |
[cljs.core.async :refer [chan <! >! put! close! alts! timeout promise-chan]]) | |
(:require-macros [cljs.core.async.macros :refer [go go-loop]])) | |
(defmacro async-test [name & form] | |
`(testing name | |
(async done | |
(do ~@form) | |
(done)))) | |
(deftest expectations-basics | |
(async-test | |
"should-work" | |
(go | |
(let [[db err] (<! (expec/create-memory-database))] | |
(<! (expec/add-expectation db {:key "my-expec-1"} 123)) | |
(is (do (not (<! (expec/is-fulfilled db "my-expec-1"))))) | |
(<! (expec/fulfill-expectation db "my-expec-1" true)) | |
(is (do (<! (expec/is-fulfilled db "my-expec-1")))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment