Liking cljdoc? Tell your friends :D

donut.endpoint.test.harness

Includes:

  • Macros and a fixture for dealing with a system for the duration of a test
  • Helpers for composing and dispatching requests
  • read-body multimethod for parsing response bodies of different types (transit, json etc)
  • assertions that work with response segments
Includes:

* Macros and a fixture for dealing with a system for the duration of a test
* Helpers for composing and dispatching requests
* `read-body` multimethod for parsing response bodies of different types (transit, json etc)
* assertions that work with response segments
raw docstring

*system*clj


comparison-entitiesclj

(comparison-entities test-ent-attrs resp-data)

Returns a set that can be used to test if test-ent-attrs is contained in a response

Returns a set that can be used to test if `test-ent-attrs` is
contained in a response
raw docstring

ConfigurationComponentGroupclj


configured-instanceclj

(configured-instance human-name component-config-id)

Look up a component instance that has path configured by the ::config component group

Look up a component instance that has path configured by the `::config`
component group
raw docstring

configured-valueclj

(configured-value config-key)

Look up a component instance that has path configured by the ::config component group

Look up a component instance that has path configured by the `::config`
component group
raw docstring

contains-entity?clj

(contains-entity? resp-data test-ent-attrs)

Request's response data creates entity of type ent-type that has key/value pairs identical to test-ent-attrs.

Request's response data creates entity of type `ent-type` that has
key/value pairs identical to `test-ent-attrs`.
raw docstring

content-type-requestclj

(content-type-request method path-or-route-name content-type)
(content-type-request method path-or-route-name params content-type)

content-type-request*cljmultimethod


Entitiesclj


Entityclj


handle-requestclj

(handle-request method path-or-route-name & args)

Perform a request with the system's root handler

Perform a request with the system's root handler
raw docstring

handlerclj

(handler)

The endpoint handler.

The endpoint handler.
raw docstring

headersclj

(headers req headers)

Add all headers to request

Add all headers to request
raw docstring

instanceclj

(instance component-id & [err-msg])

Look up component instance in current test system

Look up component instance in current test system
raw docstring

Pathcljprotocol

pathclj

(path this)

prep-comparisonclj

(prep-comparison resp-entity test-ent-attrs)

When testing whether a response contains test-ent-attrs, we modify a response entity by:

  1. selecting only the keys that are present in test-ent-attrs. This allows us to do an = comparison that won't fail if the response entity contains attributes we don't want to test.

  2. Putting the result in a map to handle case where resp-entity is a record.

When testing whether a response contains `test-ent-attrs`, we modify
a response entity by:

1. selecting only the keys that are present in
   `test-ent-attrs`. This allows us to do an `=` comparison that won't
   fail if the response entity contains attributes we don't want to
   test.

2. Putting the result in a map to handle case where `resp-entity` is
   a record.
raw docstring

read-bodycljmultimethod

Read body according to content type

Read body according to content type
raw docstring

requestclj

(request method path-or-route-name)
(request method path-or-route-name params-or-content-type)
(request method path-or-route-name params content-type)

Responseclj


response-entitiesclj

(response-entities resp-data)

Walk response data and return all entities from entity segments

Walk response data and return all entities from entity segments
raw docstring

route-pathclj

(route-path route-name)
(route-path route-name route-params)
(route-path route-name route-params query-params)

routerclj

(router)

The endpoint router.

The endpoint router.
raw docstring

Segmentclj


Segmentsclj


systemclj

(system)

more assertive system retrieval

more assertive system retrieval
raw docstring

system-fixtureclj

(system-fixture {:keys [system-name custom-config]})

To be used with use-fixtures

To be used with `use-fixtures`
raw docstring

with-systemcljmacro

(with-system {:keys [system-name custom-config]} & body)

Bind dynamic system var to a test system.

Bind dynamic system var to a test system.
raw docstring

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

× close