Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

playwright.config.ts

37 lines735 Bytes

1import { defineConfig, devices } from '@playwright/test'
2import { appServerReady } from '@tanstack/router-e2e-utils'
3​
4const isDev = process.env.MODE === 'dev'
5const PORT = Number(process.env.E2E_APP_PORT ?? 0)
6const baseURL = `http://localhost:${PORT}`
7​
8export default defineConfig({
9 testDir: './tests',
10 workers: 1,
11 reporter: [['line']],
12​
13 use: {
14 baseURL,
15 },
16​
17 webServer: {
18 command: isDev
19 ? 'pnpm dev:e2e --port 0'
20 : `pnpm build && PORT=${PORT} pnpm start`,
21 wait: appServerReady,
22 reuseExistingServer: false,
23 stdout: 'pipe',
24 env: {
25 PORT: String(PORT),
26 },
27 },
28​
29 projects: [
30 {
31 name: 'chromium',
32 use: {
33 ...devices['Desktop Chrome'],
34 },
35 },
36 ],
37})