Skip to content

chore(react-router): cleanup test setup#13724

Merged
brophdawg11 merged 3 commits intoremix-run:devfrom
MichaelDeBoey:cleanup-tests-setup-react-router
Jul 2, 2025
Merged

chore(react-router): cleanup test setup#13724
brophdawg11 merged 3 commits intoremix-run:devfrom
MichaelDeBoey:cleanup-tests-setup-react-router

Conversation

@MichaelDeBoey
Copy link
Copy Markdown
Member

@MichaelDeBoey MichaelDeBoey commented Jun 2, 2025

These are all available in Node 20 (which is the minimum we use)

Since we're still using jest and jest-environment-jsdom we unfortunatelly can't fully remove these 😢

Decided to go with @kettanaito / @mswjs' jest-fixed-jsdom though as it's handling more cases than we currently do and it's one less thing we need to worry about ourselves

@MichaelDeBoey MichaelDeBoey added dependencies Pull requests that update a dependency file pkg:react-router labels Jun 2, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2025

⚠️ No Changeset found

Latest commit: e89cec7

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

@MichaelDeBoey MichaelDeBoey force-pushed the cleanup-tests-setup-react-router branch from a26cc05 to aba1e84 Compare June 2, 2025 12:57
@kettanaito
Copy link
Copy Markdown
Contributor

Just bear in mind that jest-fixed-jsdom is largely a hack and shouldn't be used as a long-lasting solution.

If you can, please explore migrating your tests to run in the browser (Browser Mode in Vitest, Component testing in Playwright and Cypress). Much simpler setup, much better tests, but you need to pay some attention migrating.

@MichaelDeBoey MichaelDeBoey force-pushed the cleanup-tests-setup-react-router branch from aba1e84 to 5c18446 Compare June 4, 2025 22:12
@brophdawg11
Copy link
Copy Markdown
Contributor

lets stick with jest-environment-jsdom. If we can remove the undici stuff that would be cool. But lots of failing tests currently...

@brophdawg11
Copy link
Copy Markdown
Contributor

I pulled back in our global fetch patching - I would prefer not to hide that type of stuff behind a third party dependency

@brophdawg11 brophdawg11 merged commit 760ccb4 into remix-run:dev Jul 2, 2025
8 checks passed
@MichaelDeBoey MichaelDeBoey deleted the cleanup-tests-setup-react-router branch July 2, 2025 23:25
vezaynk pushed a commit to vezaynk/react-router that referenced this pull request Jul 7, 2025
* chore(react-router): cleanup test setup

* Reset back to manual node global patching

---------

Co-authored-by: Matt Brophy <matt@brophy.org>
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version 7.7.0-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version 7.7.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed dependencies Pull requests that update a dependency file pkg:react-router

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants