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

feat(expect): Expose toThrowMatchers #13328

Merged
merged 1 commit into from Sep 27, 2022

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented Sep 27, 2022

Summary

Required for facebook/react#21575
Prior art: #11932

React currently extends toThrow to normalize error messages across v8 versions: facebook/react#22477

Being able to extend this specific matcher was asked in #2547 (comment) but the issue was closed.

Without this change yarn test in facebook/react throw:

Cannot find module 'expect/build/toThrowMatchers' from 'scripts/jest/matchers/toThrow.js'

    Require stack:
      scripts/jest/matchers/toThrow.js
      scripts/jest/setupTests.js

Test plan

  • Applied patch locally

@eps1lon eps1lon force-pushed the feat/expect-expose-toThrowMatchers branch from 4c3b24c to eed2623 Compare September 27, 2022 15:48
@eps1lon eps1lon mentioned this pull request Sep 27, 2022
1 task
@eps1lon eps1lon marked this pull request as ready for review September 27, 2022 16:29
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

I hate it, but we can try to make it cleaner in the future. Like you mention, we already have some of this

@SimenB SimenB merged commit 5e51a06 into jestjs:main Sep 27, 2022
@eps1lon eps1lon deleted the feat/expect-expose-toThrowMatchers branch September 27, 2022 19:44
@SimenB
Copy link
Member

SimenB commented Sep 28, 2022

@github-actions
Copy link

This pull request 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 Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants