Skip to content
Source
Sign inSign up
TanStack/router

fix: set statusCode to 500 if error occurs #5541

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5541/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 2 changed files with 178 additions and 6 deletions.

x
0 of 2 viewed, 2 left
171 additions and 5 deletionspackages/react-router/tests/router.test.tsxModified
View file
@@ -8,7 +8,7 @@
waitFor,
} from '@testing-library/react'
import { z } from 'zod'
-import { composeRewrites } from '@tanstack/router-core'
+import { composeRewrites, notFound } from '@tanstack/router-core'
import {
Link,
Outlet,
@@ -1929,13 +1929,11 @@
-describe('statusCode reset on navigation', () => {
+describe('statusCode', () => {
it('should reset statusCode to 200 when navigating from 404 to valid route', async () => {
const history = createMemoryHistory({ initialEntries: ['/'] })
- const rootRoute = createRootRoute({
- component: () => <Outlet />,
- })
+ const rootRoute = createRootRoute()
const indexRoute = createRoute({
getParentRoute: () => rootRoute,