Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce actual for match and matchJson #36

Merged
merged 1 commit into from
Aug 20, 2018
Merged

Conversation

mantoni
Copy link
Member

@mantoni mantoni commented Aug 20, 2018

When asserting plain objects using match or matchJson, set the "actual"
object to an excerpt only containing the properties specified by the
matcher. If the original "actual" object is used, the diff produced by
test runners shows all properties that are not defined in the matcher as
missing. With this change, only properties that are actually compared
are shown.

How to verify - mandatory

  1. Check out this branch
  2. npm install
  3. npm test

Also the matchJson demo was enhanced. Run it with npm run demo.

Checklist for author

  • npm run lint passes
  • References to standard library functions are cached.

When asserting plain objects using match or matchJson, set the "actual"
object to an excerpt only containing the properties specified by the
matcher. If the original "actual" object is used, the diff produced by
test runners shows all properties that are not defined in the matcher as
missing. With this change, only properties that are actually compared
are shown.
@mantoni mantoni added the semver:minor changes will cause a new minor version label Aug 20, 2018
@mantoni mantoni requested a review from mroderick August 20, 2018 08:03
@coveralls
Copy link

Pull Request Test Coverage Report for Build 145

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 95.933%

Files with Coverage Reduction New Missed Lines %
assertions/match-json.js 2 90.48%
Totals Coverage Status
Change from base Build 143: 0.1%
Covered Lines: 553
Relevant Lines: 570

💛 - Coveralls

@mroderick
Copy link
Member

Looks good 👍

@mantoni mantoni merged commit 371f21f into master Aug 20, 2018
@mantoni
Copy link
Member Author

mantoni commented Aug 20, 2018

Released in v2.5.0.

@mantoni mantoni deleted the reduced-actual-for-match branch August 20, 2018 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor changes will cause a new minor version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants