feat: withRouteTree helper for testing full path routing behaviors#15
Merged
Conversation
c5a6827 to
b7ef305
Compare
stephenh
reviewed
Jun 8, 2026
Update to use rtl-utils library for testing. Required setting up fake timers.
stephenh
approved these changes
Jun 8, 2026
| "src": ["src"] | ||
| } | ||
| }, | ||
| "exclude": ["node_modules", "src/**/*.test.tsx", "src/setupTests.ts"] |
Contributor
There was a problem hiding this comment.
Since tsconfig.test.json went away, we probably don't want the last two excluded anymore?
Contributor
Author
There was a problem hiding this comment.
If I exclude them, then i get:
Could not find a declaration file for module '@homebound/rtl-utils'. '/Users/bdow/workspace/rtl-react-router-utils/node_modules/@homebound/rtl-utils/build/lib/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/homebound__rtl-utils` if it exists or add a new declaration (.d.ts) file containing `declare module '@homebound/rtl-utils';`ts(7016)
| * | ||
| * Does not inject QueryParamProvider; route-tree shells (e.g. AppShell) provide that. | ||
| */ | ||
| export function withRouteTree(routes: RouteObject[], url: string = "/"): MemoryRouterHelper { |
Contributor
There was a problem hiding this comment.
Another naive question, but maybe just withRoutes?
The "...Tree" made me wonder "...what's a route tree?" when really it's "just an array of RouteObject[]s" (afaiu! 😅 )
Contributor
Author
There was a problem hiding this comment.
Sure, that's fine. The tree is because of how the paths do traverse down a tree like structure.
|
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.