mirror of https://github.com/vuejs/vitepress
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
445 B
18 lines
445 B
2 years ago
|
import { chromium, type BrowserServer } from 'playwright-chromium'
|
||
|
|
||
|
let browserServer: BrowserServer
|
||
|
|
||
|
export async function setup() {
|
||
|
browserServer = await chromium.launchServer({
|
||
|
headless: !process.env.DEBUG,
|
||
|
args: process.env.CI
|
||
|
? ['--no-sandbox', '--disable-setuid-sandbox']
|
||
|
: undefined
|
||
|
})
|
||
|
process.env['WS_ENDPOINT'] = browserServer.wsEndpoint()
|
||
|
}
|
||
|
|
||
|
export async function teardown() {
|
||
|
await browserServer.close()
|
||
|
}
|