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

playwright.config.ts

38 lines804 Bytes

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