mirror of
https://github.com/cloudflare/cloudflare-docs.git
synced 2026-01-11 20:06:58 +00:00
* Move to Workers * Add a thing to force a trailing slash for redirect evaluation * Standardize _redirects * Add tests (#17503) * Exclude tests from typechecking
21 lines
507 B
TypeScript
21 lines
507 B
TypeScript
import type { GlobalSetupContext } from "vitest/node";
|
|
import puppeteer, { Browser } from "puppeteer";
|
|
|
|
let browser: Browser;
|
|
|
|
export default async function setup({ provide }: GlobalSetupContext) {
|
|
browser = await puppeteer.launch({
|
|
args: ["--no-sandbox", "--disable-setuid-sandbox"],
|
|
});
|
|
provide("browserWSEndpoint", browser.wsEndpoint());
|
|
}
|
|
|
|
export async function teardown() {
|
|
await browser.close();
|
|
}
|
|
|
|
declare module "vitest" {
|
|
export interface ProvidedContext {
|
|
browserWSEndpoint: string;
|
|
}
|
|
}
|