angel_test library

Classes

TestClient
An angel_client that sends mock requests to a server, rather than actual HTTP transactions.

Functions

connectTo(Angel app, { Map initialSession, bool autoDecodeGzip: true, bool useZone: false }) Future<TestClient>
Shorthand for bootstrapping a TestClient.
hasBody([dynamic value ]) Matcher
Expects a response to have the given body. [...]
hasContentType(dynamic contentType) Matcher
Expects a response to have the given content type, whether a String or ContentType.
hasHeader(String key, [ dynamic value ]) Matcher
Expects a response to have a header named key which contains value. value can be a String, or a List of Strings. [...]
hasStatus(int status) Matcher
Expects a response to have the given status code.
hasValidBody(Validator validator) Matcher
Expects a response to have a JSON body that is a Map and satisfies the given validator schema.
isAngelHttpException({String message, int statusCode, Iterable<String> errors: const [] }) Matcher
Expects a response to be a JSON representation of an AngelHttpException. [...]
isJson(dynamic value) Matcher
Expects a given response, when parsed as JSON, to equal a desired value.