Fix EntitiesList.test.js to properly work with vitest
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 611
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 49
Description
The EntitiesList test when ran with npx vitest run EntitiesList.test.js throws below given error. As mentioned by @eemeli in PR 3880 comment rather than hacking way around we should disable this test suite until we upgrade react which should in theory solve this import issue or enable us to upgrading react-intersection-observer to latest which requires react^17.0.0 || ^18.0.0 || ^19.0.0".
src/modules/entitieslist/components/EntitiesList.test.js [ src/modules/entitieslist/components/EntitiesList.test.js ]
Error: Cannot find module '/Users/nishit/Development/pontoon/node_modules/react-dom/test-utils' imported from /Users/nishit/Development/pontoon/node_modules/react-intersection-observer/dist/test-utils.mjs
Did you mean to import "react-dom/test-utils.js"?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/modules/entitieslist/components/EntitiesList.test.js and run npx vitest run EntitiesList.test.js to reproduce the react-dom/test-utils import error from react-intersection-observer. Review PR 3880's comment and the current test setup, then disable this test suite as described until the React dependency can be upgraded. Done means the Vitest run no longer fails on this suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100