-
-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multipart boundary mismatch (#540)
- Loading branch information
Showing
7 changed files
with
64 additions
and
31 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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {type RequestInit as UndiciRequestInit} from 'undici-types'; | ||
|
||
type CombinedRequestInit = globalThis.RequestInit & UndiciRequestInit; | ||
|
||
export type RequestInitRegistry = {[K in keyof CombinedRequestInit]-?: true}; |
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
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,19 +1,28 @@ | ||
/* eslint-disable ava/no-ignored-test-files */ | ||
import process from 'node:process'; | ||
import type {ExecutionContext, Implementation} from 'ava'; | ||
import {chromium, type Page} from 'playwright-chromium'; | ||
import test from 'ava'; | ||
import {chromium, firefox, webkit, type BrowserType, type Page} from 'playwright'; | ||
import type {ExecutionContext} from 'ava'; | ||
|
||
type Run = (t: ExecutionContext, page: Page) => Promise<void>; | ||
|
||
const PWDEBUG = Boolean(process.env['PWDEBUG']); | ||
const DEFAULT_BROWSERS = [chromium, firefox, webkit]; | ||
|
||
export const withPage: Implementation<any[]> = async (t: ExecutionContext, run: Run): Promise<void> => { | ||
const browser = await chromium.launch({ | ||
devtools: PWDEBUG, | ||
}); | ||
const page = await browser.newPage(); | ||
try { | ||
await run(t, page); | ||
} finally { | ||
await browser.close(); | ||
export const browserTest = (title: string, browserTypes: BrowserType[], run: Run) => { | ||
for (const browserType of browserTypes) { | ||
test.serial(`${browserType.name()} - ${title}`, async t => { | ||
const browser = await browserType.launch({devtools: PWDEBUG}); | ||
const page = await browser.newPage(); | ||
try { | ||
await run(t, page); | ||
} finally { | ||
await browser.close(); | ||
} | ||
}); | ||
} | ||
}; | ||
|
||
export const defaultBrowsersTest = (title: string, run: Run) => { | ||
browserTest(title, DEFAULT_BROWSERS, run); | ||
}; |