-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(remix): Do not capture thrown redirect responses.
- Loading branch information
1 parent
6d32228
commit a83d167
Showing
6 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
2 changes: 2 additions & 0 deletions
2
packages/remix/test/integration/app_v1/routes/throw-redirect.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from '../../common/routes/throw-redirect'; | ||
export { default } from '../../common/routes/throw-redirect'; |
2 changes: 2 additions & 0 deletions
2
packages/remix/test/integration/app_v2/routes/throw-redirect.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from '../../common/routes/throw-redirect'; | ||
export { default } from '../../common/routes/throw-redirect'; |
11 changes: 11 additions & 0 deletions
11
packages/remix/test/integration/common/routes/throw-redirect.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { LoaderFunction, redirect } from '@remix-run/node'; | ||
import { useLoaderData } from '@remix-run/react'; | ||
|
||
export const loader: LoaderFunction = async () => { | ||
throw redirect('/'); | ||
}; | ||
|
||
export default function ThrowRedirect() { | ||
const data = useLoaderData(); | ||
return <div>{data}</div>; | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/remix/test/integration/test/client/throw-redirect.test.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { countEnvelopes } from './utils/helpers'; | ||
|
||
test('should not report thrown redirect response on client side.', async ({ page }) => { | ||
const count = await countEnvelopes(page, { url: '/throw-redirect', envelopeType: 'event' }); | ||
|
||
expect(count).toBe(0); | ||
}); |
This file contains 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