-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
39 lines (37 loc) · 1.84 KB
/
Copy pathvitest.config.ts
File metadata and controls
39 lines (37 loc) · 1.84 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
38
39
import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
// Cross-package imports resolve to TypeScript source (not built dist), so the
// conformance suite runs without a prior build step. These aliases mirror the
// `paths` in tsconfig.base.json.
const src = (p: string) => fileURLToPath(new URL(p, import.meta.url));
export default defineConfig({
resolve: {
alias: {
"@baas/core": src("./packages/core/src/index.ts"),
"@baas/conformance": src("./packages/conformance/src/index.ts"),
// The longer name MUST precede "@baas/migrate": Vite matches aliases by
// prefix, so the bare one would otherwise capture "@baas/migrate-conformance".
"@baas/migrate-conformance": src("./packages/migrate-conformance/src/index.ts"),
"@baas/adapter-memory": src("./packages/adapter-memory/src/index.ts"),
"@baas/migrate": src("./packages/migrate/src/index.ts"),
"@baas/adapter-supabase": src("./packages/adapter-supabase/src/index.ts"),
// More specific subpath alias MUST precede the bare package alias: Vite
// matches string aliases by prefix, so the bare one would otherwise capture
// the `/convex` import too.
"@baas/adapter-convex/convex": src("./packages/adapter-convex/convex/index.ts"),
"@baas/adapter-convex": src("./packages/adapter-convex/src/index.ts"),
},
},
test: {
include: ["packages/**/*.test.ts", "examples/**/*.test.ts"],
// convex-test runs the real function code in an edge runtime and must not be
// pre-bundled (it inspects import.meta.glob module maps). Harmless for other
// packages; the convex hermetic test opts into the env via a file docblock.
server: { deps: { inline: ["convex-test"] } },
typecheck: {
enabled: true,
include: ["packages/**/*.test-d.ts"],
tsconfig: "./tsconfig.json",
},
},
});