expect_json_equivalent {httptest} | R Documentation |
Test that objects would generate equivalent JSON
Description
Named lists in R are ordered, but they translate to unordered objects in JSON. This test expectation loosens the equality check of two objects to ignore the order of elements in a named list.
Usage
expect_json_equivalent(
object,
expected,
info = NULL,
label = "object",
expected.label = "expected"
)
Arguments
object |
object to test |
expected |
expected value |
info |
extra information to be included in the message |
label |
character name by which to refer to |
expected.label |
character same as |
Value
Invisibly, returns object
for optionally passing to other
expectations.
See Also
[Package httptest version 4.2.2 Index]