-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathvitest.config.ts
More file actions
26 lines (24 loc) · 826 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
26 lines (24 loc) · 826 Bytes
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
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import { defineConfig } from "vitest/config";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const pkg = JSON.parse(
fs.readFileSync(path.resolve(__dirname, "package.json"), "utf-8"),
);
export default defineConfig({
plugins: [svelte({ preprocess: vitePreprocess() })],
resolve: {
// Match Svelte's own recommendation for testing runes-based code: force
// the browser build so component internals behave as they do at runtime.
conditions: ["browser"],
alias: {
[pkg.name]: path.resolve(__dirname, pkg.svelte),
},
},
test: {
environment: "jsdom",
include: ["tests/unit/**/*.test.ts"],
},
});