Methods and utilities to assist with unit-testing Temporal workflows
Methods and utilities to assist with unit-testing Temporal workflows
(create)
Creates a mock Temporal backend, suitable for unit testing.
A worker may be created with start
and a client may be connected with get-client
Creates a mock Temporal backend, suitable for unit testing. A worker may be created with [[start]] and a client may be connected with [[get-client]]
(get-client env)
Returns a client instance associated with the mock environment created by create
Returns a client instance associated with the mock environment created by [[create]]
(start env {:keys [task-queue] :as options})
Starts a Temporal worker associated with the mock environment created with create
.
Arguments:
options
: See temporal.client.worker/worker-options
(let [env (create)]
(start env {:task-queue ::my-queue :ctx {:some "context"}})
;; create and invoke workflows
(stop env))
Starts a Temporal worker associated with the mock environment created with [[create]]. Arguments: - `options`: See [[temporal.client.worker/worker-options]] ```clojure (let [env (create)] (start env {:task-queue ::my-queue :ctx {:some "context"}}) ;; create and invoke workflows (stop env)) ```
(stop 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 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