-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support async for proxy.bypass (#18940)
Co-authored-by: 翠 / green <[email protected]>
- Loading branch information
1 parent
05b005f
commit a6b9587
Showing
4 changed files
with
76 additions
and
21 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
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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import { expect, test, vi } from 'vitest' | ||
import { browserLogs } from '~utils' | ||
import { browserLogs, isServe, page, serverLogs } from '~utils' | ||
|
||
test('proxy-bypass', async () => { | ||
await vi.waitFor(() => { | ||
expect(browserLogs.join('\n')).toContain('status of 404 (Not Found)') | ||
}) | ||
}) | ||
|
||
test('async-proxy-bypass', async () => { | ||
const content = await page.frame('async-response').content() | ||
expect(content).toContain('Hello after 4 ms (async timeout)') | ||
}) | ||
|
||
test.runIf(isServe)('async-proxy-bypass-with-error', async () => { | ||
await vi.waitFor(() => { | ||
expect(serverLogs.join('\n')).toContain('bypass error') | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
root app<br /> | ||
<iframe src="/nonExistentApp" style="border: 0"></iframe> | ||
<iframe src="/asyncResponse" name="async-response"></iframe> | ||
<iframe src="/asyncThrowingError"></iframe> |
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