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

playwright.config.ts

33 lines722 Bytes

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