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

chore(expect): expose default matchers #11932

Merged
merged 3 commits into from
Oct 5, 2021

Conversation

mxschmitt
Copy link
Contributor

@mxschmitt mxschmitt commented Oct 5, 2021

Summary

Projects which use expect sometimes want to have access to the default matchers before they get overridden. This was not possible before and lead to ERR_PACKAGE_PATH_NOT_EXPORTED. After this change it's possible to require it via expect/build/matchers.

Context:

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2021

Codecov Report

Merging #11932 (cd8ffe4) into main (508827c) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11932      +/-   ##
==========================================
- Coverage   68.75%   68.74%   -0.01%     
==========================================
  Files         322      322              
  Lines       16587    16587              
  Branches     4787     4787              
==========================================
- Hits        11404    11403       -1     
- Misses       5151     5152       +1     
  Partials       32       32              
Impacted Files Coverage Δ
packages/expect/src/utils.ts 95.85% <0.00%> (-0.52%) ⬇️

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 508827c...cd8ffe4. Read the comment docs.

@mxschmitt mxschmitt requested a review from SimenB October 5, 2021 15:35
@SimenB
Copy link
Member

SimenB commented Oct 5, 2021

We can do this for now, but I'll probably remove it from Jest 28 (in favour of a more explicit import (somehow)).

Is this one change enough for you in playwright?

@SimenB
Copy link
Member

SimenB commented Oct 5, 2021

Also, can you rebase? Just to trigger GH actions which was down when you opened this (https://www.githubstatus.com/incidents/bdbzpz7qxmbx)

@mxschmitt
Copy link
Contributor Author

mxschmitt commented Oct 5, 2021

Is this one change enough for you in playwright?

Yes looks good from our side. We then only mirror printReceivedStringContainExpectedSubstring + ​printReceivedStringContainExpectedResult which seems maintainable. Once Jest 28 switched to ESM and the exports are easier, we can figure out something for them if needed.

Thanks Simen. 👍

just to maybe trigger ci
@SimenB
Copy link
Member

SimenB commented Oct 5, 2021

Lint is still unhappy. I'm on mobile, otherwise I'd fix it 🙂

@mxschmitt
Copy link
Contributor Author

Its fixed now, thanks!

@SimenB SimenB merged commit 24f9bc8 into jestjs:main Oct 5, 2021
@SimenB
Copy link
Member

SimenB commented Oct 8, 2021

https://github.com/facebook/jest/releases/tag/v27.2.5

@mxschmitt
Copy link
Contributor Author

Thanks Simen, works! do you think its also possible to merge #11498?

@github-actions
Copy link

github-actions bot commented Nov 8, 2021

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 Nov 8, 2021
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.

4 participants