-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ref: NuqsTestingAdapter #102387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref: NuqsTestingAdapter #102387
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #102387 +/- ##
========================================
Coverage 80.96% 80.96%
========================================
Files 8819 8819
Lines 390155 390155
Branches 24832 24832
========================================
Hits 315878 315878
Misses 73911 73911
Partials 366 366 |
| ? `${location.pathname}${queryString}` | ||
| : location.pathname; | ||
|
|
||
| // The navigate function from TestRouter already wraps this in act() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is surprisingly true
| // eslint-disable-next-line react-hooks/rules-of-hooks | ||
| const location = useLocation(); | ||
| // eslint-disable-next-line react-hooks/rules-of-hooks | ||
| const navigate = useNavigate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this area was most surprising to me after looking at the result of what was vibe coded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I tried moving it out but it didn’t work :/
I think it’s good enough like this, I’d appreciate a ✅ so we can merge it, as we already have PRs blocked by this 🙏
Continued from - #101616 This PR creates a `SentryNuqsTestingAdapter` that uses our `useLocation` and `useNavigate` hooks to interface with nuqs in tests so that it uses our testing router as the source of truth
Continued from
This PR creates a
SentryNuqsTestingAdapterthat uses ouruseLocationanduseNavigatehooks to interface with nuqs in tests so that it uses our testing router as the source of truth