Methods and utilities to assist with unit-testing Temporal workflows
Methods and utilities to assist with unit-testing Temporal workflows
(create {:keys [task-queue] :as options})
Creates a mock environment and an associated client connection for emulating the combination of a worker and a Temporal backend, suitable for unit testing.
Arguments:
options
: See temporal.client.worker/worker-options
(let [{:keys [client] :as instance} (create {:task-queue ::my-queue :ctx {:some "context"}}]
;; create and invoke workflows
(stop instance))
Creates a mock environment and an associated client connection for emulating the combination of a worker and a Temporal backend, suitable for unit testing. Arguments: - `options`: See [[temporal.client.worker/worker-options]] ```clojure (let [{:keys [client] :as instance} (create {:task-queue ::my-queue :ctx {:some "context"}}] ;; create and invoke workflows (stop instance)) ```
(stop {:keys [env]})
Stops the test environment created by create
. Does not wait for shutdown to complete. For coordinated shutdown,
see synchronized-stop
.
(stop instance)
Stops the test environment created by [[create]]. Does not wait for shutdown to complete. For coordinated shutdown, see [[synchronized-stop]]. ```clojure (stop instance) ```
(synchronized-stop {:keys [env]})
Stops the test environment created by create
. Blocks until the environment has shut down. For async termination,
see stop
(synchronized-stop instance)
Stops the test environment created by [[create]]. Blocks until the environment has shut down. For async termination, see [[stop]] ```clojure (synchronized-stop instance) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close