-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit fbedc50
test(router-core): add initial tests for router behavior (#4993)
First PR to add framework agnostic unit tests covering router behavior.
We need to add many more (and eventually lighten the tests in each
framework).
This PR adds tests about when a beforeLoad and a loader should execute.
Next PR should add tests about how context is passed.
Look at these issues to see what should be tested:
#4696
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Added comprehensive tests validating preload behavior for route
loading hooks (beforeLoad and loader), covering resolved, pending, and
rejected outcomes including notFound and redirects.
* Verifies navigation control flow, hook invocation counts, pending vs
cached matches, final locations, and loader data handling.
* Includes sibling-route "stay" scenarios and timing helpers to
strengthen async/timing reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent 741821b commit fbedc50Copy full SHA for fbedc50
File tree
Expand file treeCollapse file tree
1 file changed
+465
-0
lines changedFilter options
- packages/router-core/tests
Expand file treeCollapse file tree
1 file changed
+465
-0
lines changed
0 commit comments