-
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Version
System:
OS: macOS 15.6.1
CPU: (14) arm64 Apple M4 Max
Memory: 3.81 GB / 36.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Chrome: 143.0.7499.170
Safari: 18.6
npmPackages:
@rstest/core: ^0.7.7 => 0.7.7Details
I have a very basic react app with react-router-dom with path params. I am using useParams to get path params in component and just displaying it. I am unable to mock the react-router-dom module with right useParams return value
src/pages/Menu1.test.tsx (in reproduction repo) has 2 tests, first one trying to use react-router-dom mocked version, and it fails. 2nd test uses complete route structure and it passes. I have tried rs.doMock, rs.mock but still not working.
Same test works with jest
Any help would be appreciated.
Reproduce link
https://github.com/saravmajestic/rstest-react-router-dom-mock
Reproduce Steps
yarn installyarn test- Will show 1 failed and 1 passed test.
Failed test tries to use mocked react-router-dom.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels