Skip to content

Commit fbedc50

Browse files
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 fbedc50

File tree

1 file changed

+465
-0
lines changed

1 file changed

+465
-0
lines changed

0 commit comments

Comments
 (0)