You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/remarkablemark/mui-template.git
cd mui-template
git checkout dependabot/npm_and_yarn/react-router-dom-7.0.1
npm install
npm test
I tried replacing react-router-dom with react-router but got the same error
Expected Behavior
Jest tests pass with latest react-router version
Actual Behavior
Jest tests failing with error:
ReferenceError: TextEncoder is not defined
2 | import type { ReactElement, ReactNode } from 'react';
3 | import { Provider } from 'react-redux';
> 4 | import { createMemoryRouter, RouterProvider } from 'react-router-dom';
| ^
5 | import { resetActions, store } from 'src/store';
6 |
7 | export { store };
at Object.<anonymous> (node_modules/react-router/dist/production/index.js:8368:15)
at Object.<anonymous> (node_modules/react-router-dom/dist/index.js:39:38)
at Object.<anonymous> (test/helpers.tsx:4:1)
at Object.<anonymous> (test/setupTests.ts:7:1)
The text was updated successfully, but these errors were encountered:
Update 1: upgrading Node.js didn't fix it, but I noticed that jsdom is currently v25 so let me try to update that in my project
Update 2: I tried upgrading jest-environment-jsdom from 29.7.0 to 30.0.0-alpha.6 but it still failed locally for me. I can confirm the jsdom version did go up:
What version of React Router are you using?
7.0.1
Steps to Reproduce
remarkablemark/mui-template#1082
I tried replacing
react-router-dom
withreact-router
but got the same errorExpected Behavior
Jest tests pass with latest
react-router
versionActual Behavior
Jest tests failing with error:
The text was updated successfully, but these errors were encountered: