forked from silvanocerza/github-gitless-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
32 lines (31 loc) · 1.29 KB
/
Copy pathvitest.config.ts
File metadata and controls
32 lines (31 loc) · 1.29 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
import { defineConfig } from "vitest/config";
import path from "path";
export default defineConfig({
test: {
include: ["tests/**/*.test.ts"],
// Integration tests live under tests/integration/ and perf
// baselines under tests/perf/. Both reach the real GitHub API
// and have their own configs (vitest.integration.config.ts and
// vitest.perf.config.ts). Keep them out of the unit run.
exclude: [
"**/node_modules/**",
"tests/integration/**",
"tests/perf/**",
],
// The Obsidian runtime isn't available under Node — alias to the same
// mock-obsidian.ts the benchmark script uses. Pure-function tests then
// run unchanged: anything that touches the actual Obsidian API would
// need integration-style tests, which we'll add later.
//
// The `src` alias mirrors tsconfig.json's baseUrl: src files use
// bare `src/...` imports (esbuild handles them in production), so
// vitest needs the same resolution at test time. Without it, IDE
// runners that bypass `pnpm test` (PyCharm, VS Code) hit
// "Cannot find package 'src/utils'" the moment a test loads any
// file that uses the bare-import form.
alias: {
obsidian: path.resolve(__dirname, "mock-obsidian.ts"),
src: path.resolve(__dirname, "src"),
},
},
});