expect_json_equivalent | R Documentation |
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"
)
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 |
Invisibly, returns object
for optionally passing to other
expectations.
testthat::expect_equivalent()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.