Skip to main content

StringifiedJson

Transformation matcher that matches a JSON.stringify()ed version of the given object.

For example, if the actual data is the string:

"{\"foo\":2}"

then you could match it with:

StringifiedJson({
"foo": 2
})

or

StringifiedJson({
"foo": AnyNumber(2)
})
import { matchers } from '@contract-case/case-definition-dsl'

new matchers.strings.StringifiedJson(child: any)

Parameters

NameTypeDescription
childanyThe object or matcher that matches the decoded.