-
Notifications
You must be signed in to change notification settings - Fork 551
Expand file tree
/
Copy pathvitest.config.ts
More file actions
37 lines (36 loc) · 1.03 KB
/
vitest.config.ts
File metadata and controls
37 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import path from "node:path";
import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
test: {
globals: true,
browser: {
provider: playwright(),
enabled: true,
instances: [{ browser: "chromium" }],
commands: {
// Uses Chrome DevTools Protocol to override the timezone at runtime,
// since process.env.TZ has no effect in a real browser environment.
async setTimezone({ context, page }, timezoneId: string) {
const session = await context.newCDPSession(page);
await session.send("Emulation.setTimezoneOverride", { timezoneId });
await session.detach();
},
},
},
exclude: [
"**/node_modules/**",
"doc/**",
"src/**/*.integration.test.{ts,tsx}",
"supabase/**",
],
},
resolve: {
preserveSymlinks: true,
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
});