Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Update @testing-library/jest-dom to v6 #42

Merged
merged 9 commits into from
Aug 29, 2023
Merged

Update @testing-library/jest-dom to v6 #42

merged 9 commits into from
Aug 29, 2023

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Aug 23, 2023

This updates to the latest jest-dom, which publishes ESM, removing the need for our previous matcher hack.

Change Type

Indicate the type of change your pull request is:

  • maintenance
  • documentation
  • patch
  • minor
  • major
📦 Published PR as canary version: 0.2.2--canary.42.6016476959.0

✨ Test out this PR locally via:

npm install @storybook/[email protected]
# or 
yarn add @storybook/[email protected]

Version

Published prerelease version: v0.2.2-next.0

Changelog

🐛 Bug Fix

Authors: 2

@socket-security
Copy link

socket-security bot commented Aug 23, 2023

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: @storybook/[email protected], @testing-library/[email protected]

@IanVS IanVS force-pushed the jest-dom branch 2 times, most recently from ce81fe8 to f4a34c9 Compare August 23, 2023 14:54
@IanVS
Copy link
Member Author

IanVS commented Aug 23, 2023

Cool, I tested this out in my pnpm vite project, and I was able to remove public-hoist-pattern[]=@types* from my .npmrc, since the latest jest-dom no longer uses definitely-typed, but publishes types itself.

Copy link

@jasikpark jasikpark left a comment

Choose a reason for hiding this comment

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

w/o context, code looks reasonable :p

@IanVS
Copy link
Member Author

IanVS commented Aug 25, 2023

In order for this to work correctly in vitest, we'll also need storybookjs/expect#77.

Base automatically changed from cleanup to next August 29, 2023 08:17
@yannbf
Copy link
Member

yannbf commented Aug 29, 2023

Hey @IanVS thanks a lot for this! I made a canary release of the expect changes in storybookjs/expect#77 and updated this PR (but it should be reverted later) so you can try out the canary release of this package

@yannbf yannbf marked this pull request as ready for review August 29, 2023 09:09
@IanVS
Copy link
Member Author

IanVS commented Aug 29, 2023

Thanks @yannbf, I tested it out, and it's working beautifully in my pnpm project, without the need to install the jest-dom types or hoist types in my .npmrc or anything like that.

@yannbf
Copy link
Member

yannbf commented Aug 29, 2023

That's great! so we can undo the commit where I changed the version of expect, I can do a proper release of expect and we can merge this. Before though, I wonder if you know whether there are any possible breaking changes with the upgrade?

@IanVS
Copy link
Member Author

IanVS commented Aug 29, 2023

I don't believe there are any breaking changes here. The breaking changes in jest-dom were the removal of an undocumented api that we don't use (extend-expect), and dropping node < 14. We could potentially remove https://github.com/storybookjs/jest#typescript-does-not-recognize-expecttobeinthedocument, or at least I should probably update it to not mention @types/testing-library__jest-dom since that is no longer used. I think the whole section can just be removed now though, because it just works out of the box. I'll push up a commit to this PR that does that.

@yannbf yannbf added the patch Increment the patch version when merged label Aug 29, 2023
@yannbf yannbf changed the title Update @testing-library/jest-dom and remove matcher hack Update @testing-library/jest-dom to v6 Aug 29, 2023
@yannbf yannbf merged commit 128dedf into next Aug 29, 2023
1 check passed
@yannbf yannbf deleted the jest-dom branch August 29, 2023 19:08
@github-actions github-actions bot added the prerelease This change is available in a prerelease. label Aug 29, 2023
@yannbf yannbf mentioned this pull request Aug 29, 2023
@github-actions
Copy link

🚀 PR was released in v0.2.2 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants