expectJson static method

void expectJson(
  1. HttpResponseSpec response,
  2. String pointer,
  3. Object? expected
)

Asserts that a JSON pointer equals expected.

Implementation

static void expectJson(
  HttpResponseSpec response,
  String pointer,
  Object? expected,
) {
  final actual = jsonPointer(response.body, pointer);
  if (actual != expected) {
    throw StateError('Expected $pointer=$expected, got $actual');
  }
}