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.
expect_json_equivalent(
object,
expected,
info = NULL,
label = "object",
expected.label = "expected"
)
Invisibly, returns object
for optionally passing to other
expectations.
object to test
expected value
extra information to be included in the message
character name by which to refer to object
in the test
result. Because the tools for deparsing object names that 'testthat' uses
aren't exported from that package, the default here is just "object".
character same as label
but for expected