Open History to see the last commit
1import { fileURLToPath } from "node:url";
2import { playwright } from "@vitest/browser-playwright";
3import { defineConfig, mergeConfig } from "vitest/config";
4
5import viteConfig from "./vite.config";
6
7const srcPath = fileURLToPath(new URL("./src", import.meta.url));
8
9export default mergeConfig(
10 viteConfig,
11 defineConfig({
12 resolve: {
13 alias: {
14 "~": srcPath,
15 },
16 },
17 server: {
18 // The app dev server uses a fixed port, but browser tests need to allow
19 // concurrent runs to claim the next available port.
20 strictPort: false,
21 },
22 test: {
23 include: ["src/components/**/*.browser.tsx"],
24 browser: {
25 enabled: true,
26 provider: playwright(),
27 instances: [{ browser: "chromium" }],
28 headless: true,
29 api: {
30 strictPort: false,
31 },
32 },
33 testTimeout: 30_000,
34 hookTimeout: 30_000,
35 },
36 }),
37);