forked from shikijs/shiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
43 lines (40 loc) · 1.1 KB
/
playwright.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { PlaywrightTestConfig } from '@playwright/test'
import { devices } from '@playwright/test'
const PORT = +process.env.PORT || 3000
const SERVER = `http://127.0.0.1:${PORT}`
const config: PlaywrightTestConfig = {
timeout: 15 * 1000,
expect: {
timeout: 5000
},
globalSetup: './scripts/e2e/setup.mjs',
globalTeardown: './scripts/e2e/teardown.mjs',
snapshotPathTemplate: './packages/shiki/src/__tests__/__screenshots__{/projectName}/{arg}{ext}',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? [['github'], ['html']] : 'html',
use: {
baseURL: SERVER,
trace: 'on-first-retry',
headless: true
},
projects: [
{
name: 'shiki-browser',
testMatch: /packages\/shiki\/src\/__tests__\/e2e.browser.spec.ts/,
use: {
...devices['Desktop Chrome']
}
},
{
name: 'shiki-cdn',
testMatch: /packages\/shiki\/src\/__tests__\/e2e.cdn.spec.ts/,
use: {
...devices['Desktop Chrome']
}
}
]
}
export default config