generated from trpc/examples-next-prisma-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.playwright.config.ts
35 lines (32 loc) · 943 Bytes
/
jest.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
import type { Config } from '@jest/types';
const opts = {
// launch headless on CI, in browser locally
headless: !!process.env.CI || !!process.env.PLAYWRIGHT_HEADLESS,
collectCoverage: !!process.env.PLAYWRIGHT_HEADLESS,
executablePath: process.env.PLAYWRIGHT_CHROME_EXECUTABLE_PATH,
};
const config: Config.InitialOptions = {
verbose: true,
preset: 'jest-playwright-preset',
transform: {
'^.+\\.ts$': 'ts-jest',
},
testMatch: ['<rootDir>/playwright/**/*(*.)@(spec|test).[jt]s?(x)'],
testEnvironmentOptions: {
'jest-playwright': {
browsers: ['chromium' /*, 'firefox', 'webkit'*/],
exitOnPageError: false,
launchOptions: {
headless: opts.headless,
executablePath: opts.executablePath,
},
contextOptions: {
recordVideo: {
dir: 'playwright/videos',
},
},
collectCoverage: opts.collectCoverage,
},
},
};
export default config;