Open History to see the last commit
1import { defineConfig, devices } from '@playwright/test'
2import {
3 getDummyServerPort,
4 getTestServerPort,
5} from '@tanstack/router-e2e-utils'
6import packageJson from './package.json' with { type: 'json' }
7β
8const PORT = await getTestServerPort(packageJson.name)
9const EXTERNAL_PORT = await getDummyServerPort(packageJson.name)
10β
11const baseURL = `http://localhost:${PORT}`
12β
13export default defineConfig({
14 testDir: './tests',
15 workers: 1,
16β
17 reporter: [['line']],
18β
19 use: {
20 baseURL,
21 },
22β
23 webServer: {
24 command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`,
25 url: baseURL,
26 reuseExistingServer: !process.env.CI,
27 stdout: 'pipe',
28 },
29β
30 projects: [
31 {
32 name: 'chromium',
33 use: { ...devices['Desktop Chrome'] },
34 },
35 ],
36})