react-router icon indicating copy to clipboard operation
react-router copied to clipboard

chore: update to Jest v29

Open SimenB opened this issue 3 years ago • 3 comments

👋

I noticed you were on an old version when looking through the code, so I thought to update it.

Main changes are:

  • Update RN, stop hoisting it and use own transformer
  • Set default test env to jsdom (changed default in Jest 27)
  • Map some @remix-run/* modules to their CJS counterpart
    • This is due to Jest supporting exports, and those modules always serving ESM when Jest provides browser and require conditions. See https://jestjs.io/docs/28.x/upgrading-to-jest28#packagejson-exports
    • This could probably be fixed by tweaking the exports in those modules, but I didn't look into it
  • Update snapshots due to changed defaults: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format

SimenB avatar Sep 14 '22 07:09 SimenB

⚠️ No Changeset found

Latest commit: af34fb4508c704edfbd94c50ce5d939597766d0d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Sep 14 '22 07:09 changeset-bot[bot]

Hi @SimenB,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected].

Thanks!

- The Remix team

remix-cla-bot[bot] avatar Sep 14 '22 07:09 remix-cla-bot[bot]

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

remix-cla-bot[bot] avatar Sep 14 '22 07:09 remix-cla-bot[bot]

Hey team, any update on getting this merged? Jest 28+ doesn't appear to be compatible with Remix packages without addressing the package import issue mentioned above. Thanks!

mattrigg9 avatar Jan 12 '23 17:01 mattrigg9

I fixed the conflicts, but it looks like there's been enough updates since this PR to require more changes. Let me look into it...

timdorr avatar Jan 12 '23 17:01 timdorr

@timdorr seems like snapshots are different since Jest 29 https://jestjs.io/blog/2022/08/25/jest-29 and need to be updated.

bgaleotti avatar Jan 12 '23 17:01 bgaleotti

OK, now for the fun part: This was based on main, not the dev branch (which should be ahead code-wise and is where this should target). I got it fixed on main, so hopefully this is just resolving those conflicts. Fun! :S

timdorr avatar Jan 12 '23 17:01 timdorr

Switching to #9895 because I can't push to this remote branch anymore. Not Simen's fault, just a GitHub thing.

timdorr avatar Jan 12 '23 18:01 timdorr