Utils that help write tests for async behavior.
Utils that help write tests for async behavior.
(dq!)
(dq! timeout)
Dequeue from the bound queue q. Waits timeout millisecond for a value to show up in the queue if none are currently present. Returns :timeout if no value showed up in the queue after waiting timeout ms time. Use it in async tests to grab queued with q! values in order to assert that all the async code queued what you expect and in the right amount of time.
Dequeue from the bound queue *q*. Waits timeout millisecond for a value to show up in the queue if none are currently present. Returns :timeout if no value showed up in the queue after waiting timeout ms time. Use it in async tests to grab queued with q! values in order to assert that all the async code queued what you expect and in the right amount of time.
(q! x)
Enqueue x into the bound queue q. Use it in async tests, to queue up values you want to assert later in the test.
Enqueue x into the bound queue *q*. Use it in async tests, to queue up values you want to assert later in the test.
(testa & body)
Like clojure.test's testing macro, but also binds q to a new queue to be used for just the test inside the body of testa. Use it instead of testing for async tests.
Like clojure.test's testing macro, but also binds *q* to a new queue to be used for just the test inside the body of testa. Use it instead of testing for async tests.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close