Files
zerobyte/vitest.config.ts
Nico 4305057185 test: move test runner from Bun to Vitest (#727)
* chore: migrate to vitest

* test: speed up some suites by sharing sessions and mocking expensive non-tested actions

* test: refactor some tests to verify behavior instead of implementation details

* chore: fix linting issues
2026-04-01 20:05:54 +02:00

54 lines
1.1 KiB
TypeScript

import path from "node:path";
import { defineConfig } from "vitest/config";
export default defineConfig({
resolve: {
alias: {
"~": path.resolve(import.meta.dirname, "app"),
},
},
test: {
server: {
deps: {
inline: ["zod"],
},
},
projects: [
{
extends: true,
test: {
name: "server",
environment: "node",
include: ["app/**/*.test.ts", "app/**/*.test.tsx", "app/**/*.spec.ts", "app/**/*.spec.tsx"],
exclude: [
"app/client/**/*.test.ts",
"app/client/**/*.test.tsx",
"app/client/**/*.spec.ts",
"app/client/**/*.spec.tsx",
],
setupFiles: ["./app/test/setup.ts"],
},
},
{
extends: true,
test: {
name: "client",
environment: "happy-dom",
environmentOptions: {
happyDOM: {
url: "http://localhost:3000",
},
},
include: [
"app/client/**/*.test.ts",
"app/client/**/*.test.tsx",
"app/client/**/*.spec.ts",
"app/client/**/*.spec.tsx",
],
setupFiles: ["./app/test/setup-client.ts"],
},
},
],
},
});