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

Add toInclude #85

Merged
merged 4 commits into from
Oct 26, 2017
Merged

Add toInclude #85

merged 4 commits into from
Oct 26, 2017

Conversation

grug
Copy link
Contributor

@grug grug commented Oct 26, 2017

What

Add toInclude matcher.

Why

Closes #41

Notes

Housekeeping

  • Unit tests
  • Documentation is up to date
  • No additional lint warnings
  • Add yourself to contributors list (yarn contributor)

@mattphillips
Copy link
Member

Looks good @grug just need to rebase master back into your branch 😄

@codecov-io
Copy link

codecov-io commented Oct 26, 2017

Codecov Report

Merging #85 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #85   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          48     50    +2     
  Lines         216    225    +9     
  Branches       30     31    +1     
=====================================
+ Hits          216    225    +9
Impacted Files Coverage Δ
src/matchers/toInclude/predicate.js 100% <100%> (ø)
src/matchers/toInclude/index.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3cfaab4...c67e404. Read the comment docs.

@grug
Copy link
Contributor Author

grug commented Oct 26, 2017

Awesome. I think I've rebased that correctly. Let me know if you need anything else for this PR to be merged :)


import predicate from './predicate';

const passMessage = (actual, expected) => () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this function isn't returning the message if you remove the curly braces it should fix this snapshot:

exports[`.toInclude .not.toInclude fails when a string does have a given substring 1`] = `"<red>No message was specified for this matcher.</>"`;
const passMessage = (actual, expected) => () =>
  matcherHint('.not.toInclude') +
    '\n\n' +
    'Expected string to not include:\n' +
    `  ${printExpected(expected)}\n` +
    'Received:\n' +
    `  ${printReceived(actual)}`;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup I'll fix that now

@grug
Copy link
Contributor Author

grug commented Oct 26, 2017

Okay - I've fixed up the changes you've suggested :) let me know if I should do anything else before this can be merged.

@mattphillips mattphillips merged commit 3fdb024 into jest-community:master Oct 26, 2017
@mattphillips
Copy link
Member

Good job @grug thanks!

@grug grug deleted the toInclude branch November 22, 2017 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants