- 
                Notifications
    You must be signed in to change notification settings 
- Fork 31
Open
Labels
Description
In referee, we have assert.json(actual, expected) which attempts to parse actual with JSON.parse and compares the result to expected. It would be nice to have a matcher that does the same and can be used like this:
assert.equals(actual, {
  some: 'thing',
  json: match.json({
    parsed: true
  })
});Or with sinon assertions:
sinon.assert.calledWith(fake, match.json({
  my: 'json'
}));I'm unsure about a naming ambiguity though: We also have assert.matchJson(actual, expectation) which parses actual with JSON.parse and compares the result to expected using the same semantics of assert.match.
How would match.json behave? And what would be the counterpart?
richard-lopes-ifood, timmydoza and Yihao-G