Skip to content

test: Add testBodyJSON, remove testBody.

The new function testBodyJSON ensures that the request body decodes as JSON and that the resulting data structure is equal to a provided data structure.

This has several benefits over the previously used testBody function:

  • The field order is ignored
  • Any non-significant whitespace is ignored
  • Valid JSON syntx is enforced

Since all uses of testBody were using it to check for JSON data, no call sites remain and the function has been removed.

Merge request reports

Loading