-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1359571
commit 7c7789d
Showing
5 changed files
with
1,121 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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(); | ||
provide("browserWSEndpoint", browser.wsEndpoint()); | ||
} | ||
|
||
export async function teardown() { | ||
await browser.close(); | ||
} | ||
|
||
declare module "vitest" { | ||
export interface ProvidedContext { | ||
browserWSEndpoint: string; | ||
} | ||
} |
Oops, something went wrong.