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

Matcher messages must be a function. #3921

Closed
cpojer opened this issue Jun 27, 2017 · 7 comments
Closed

Matcher messages must be a function. #3921

cpojer opened this issue Jun 27, 2017 · 7 comments

Comments

@cpojer
Copy link
Member

cpojer commented Jun 27, 2017

For performance reasons, we should make a breaking change that all matcher messages are functions typed () => string rather than string. We already do that within all of Jest's matchers, but we don't enforce it. We should do this for 20.1.

@thymikee
Copy link
Collaborator

Maybe worth scheduling for 21 if that's breaking?

@cpojer
Copy link
Member Author

cpojer commented Jun 27, 2017

20.1 is fine.

@anilreddykatta
Copy link
Contributor

@cpojer Can you provide an example of the possible change? I didn't quite get what is the intended behavior. I can take it up!

@cpojer
Copy link
Member Author

cpojer commented Jul 1, 2017

Basically remove this if-check and always treat message as a function: https://github.com/facebook/jest/blob/master/packages/jest-matchers/src/index.js#L105

and then update everywhere that may need updating, including the types.

@jseminck
Copy link
Contributor

jseminck commented Jul 6, 2017

If no one is taking a look at this, then I'd like to give it a shot!

@cpojer
Copy link
Member Author

cpojer commented Jul 6, 2017

Go for it!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants