Liking cljdoc? Tell your friends :D

martian.test


always-generate-responseclj/s

(always-generate-response response-type)
source

bb-http-client-responderclj

source

clj-http-responderclj

source

cljs-http-promise-respondercljs

source

cljs-http-respondercljs

source

constant-responsesclj/s

(constant-responses response-map)
source

contextual-responsesclj/s

(contextual-responses response-fn)
source

generate-error-responseclj/s

source

generate-responseclj/s

source

generate-responsesclj/s

(generate-responses response-types)
source

generate-success-responseclj/s

source

hato-responderclj

source

http-client->interceptorclj/s

(http-client->interceptor http-client)
source

httpkit-responderclj

source

replace-http-interceptorsclj/s

(replace-http-interceptors martian)
source

respond-asclj/s

(respond-as martian http-client)

Adds an interceptor that simulates wrapping a response into the http-client implementation-specific returned type.

Implementation of HTTP requests — as provided by target HTTP clients (httpkit, clj-http, cljs-http, ...) — may give responses wrapped in an implementation-specific type, e.g. promise or core.async channel. As your production code will expect these response types this interceptor lets you simulate those response wrappers.

You only need to call this if you have a martian instance created without the standard HTTP-specific interceptors, i.e. those found in martian.httpkit, martian.clj-http and so on.

Removes all interceptors that would perform real HTTP operations.

Adds an interceptor that simulates wrapping a response into the `http-client` implementation-specific returned type.

Implementation of HTTP requests — as provided by target HTTP clients (httpkit, clj-http, cljs-http, ...) — may give
responses wrapped in an implementation-specific type, e.g. promise or `core.async` channel. As your production code
will expect these response types this interceptor lets you simulate those response wrappers.

You only need to call this if you have a `martian` instance created without the standard HTTP-specific interceptors,
i.e. those found in `martian.httpkit`, `martian.clj-http` and so on.

Removes all interceptors that would perform real HTTP operations.
sourceraw docstring

respond-withclj/s

(respond-with martian responses)

Adds an interceptor that simulates the server responding with the supplied responses.

See docstrings of respond-with-constant and respond-with-contextual for details.

Removes all interceptors that would perform real HTTP operations.

Adds an interceptor that simulates the server responding with the supplied `responses`.

See docstrings of `respond-with-constant` and `respond-with-contextual` for details.

Removes all interceptors that would perform real HTTP operations.
sourceraw docstring

respond-with-constantclj/s

(respond-with-constant martian response-map)

Adds an interceptor that simulates the server responding with responses retrieved from a given response-map.

The response-map maps a :route-name to a response (plain value) or a unary function that, given the request, returns a response.

Removes all interceptors that would perform real HTTP operations.

Adds an interceptor that simulates the server responding with responses retrieved from a given `response-map`.

The `response-map` maps a `:route-name` to a response (plain value) or a unary function that, given the request,
returns a response.

Removes all interceptors that would perform real HTTP operations.
sourceraw docstring

respond-with-contextualclj/s

(respond-with-contextual martian response-fn)

Adds an interceptor that simulates the server responding with responses retrieved via a given response-fn.

The response-fn is a unary function that, given the ctx, returns a response.

It provides even more flexibility than respond-with-constant by allowing one to leverage the ctx internals for response production, e.g. directly use :params to avoid JSON decoding/encoding round trips. Be careful though, since this may result in the production of responses becoming "less realistic".

Removes all interceptors that would perform real HTTP operations.

Adds an interceptor that simulates the server responding with responses retrieved via a given `response-fn`.

The `response-fn` is a unary function that, given the `ctx`, returns a response.

It provides even more flexibility than `respond-with-constant` by allowing one to leverage the `ctx` internals
for response production, e.g. directly use `:params` to avoid JSON decoding/encoding round trips. Be careful
though, since this may result in the production of responses becoming "less realistic".

Removes all interceptors that would perform real HTTP operations.
sourceraw docstring

respond-with-generatedclj/s

(respond-with-generated martian response-types)

Adds an interceptor that simulates the server responding with responses generated from the handler response schemas.

The response-types maps a :route-name to a response type which can be :random (default, any HTTP status code), :success (HTTP status codes 200-399), or :error (HTTP status codes 400-599).

Removes all interceptors that would perform real HTTP operations.

Adds an interceptor that simulates the server responding with responses generated from the handler response schemas.

The `response-types` maps a `:route-name` to a response type which can be `:random` (default, any HTTP status code),
`:success` (HTTP status codes 200-399), or `:error` (HTTP status codes 400-599).

Removes all interceptors that would perform real HTTP operations.
sourceraw docstring

response-generatorclj/s

(response-generator {:keys [handlers]} route-name)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close