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

playwright.config.ts

34 lines723 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​
12 workers: 1,
13​
14 reporter: [['line']],
15​
16 use: {
17 /* Base URL to use in actions like `await page.goto('/')`. */
18 baseURL,
19 },
20​
21 webServer: {
22 command: `pnpm build && pnpm preview --port ${PORT}`,
23 wait: appServerReady,
24 reuseExistingServer: false,
25 stdout: 'pipe',
26 },
27​
28 projects: [
29 {
30 name: 'chromium',
31 use: { ...devices['Desktop Chrome'] },
32 },
33 ],
34})