Utilities
diff
The diff
utility makes it easier to provide a helpful suggestion for check messages.
We use the jest-diff
utility to generate a diff that highlights values present in target
but not source
.
Values will be stringified and parsed as lines of text. Lines that appear in target
but not source
will appear in red with a +
prefix.
Parameters
Any value, representing the source of the diff.
Any value, representing the target of the diff.
Returns
Returns a string representing the diff between source
and target
.
Example
Was this page helpful?