Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
56 lines (54 loc) · 1.92 KB
/
Copy pathvitest.config.ts
File metadata and controls
56 lines (54 loc) · 1.92 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { defineConfig } from 'vitest/config';
const shared = {
environment: 'jsdom' as const,
globals: false,
setupFiles: ['./test/setup.ts'],
};
export default defineConfig({
test: {
coverage: {
provider: 'v8',
include: ['src/**/*.{ts,tsx}'],
// Only these two index files are pure re-export barrels. Adapter entry
// files contain implementation and must remain visible in coverage.
exclude: ['src/index.ts', 'src/core/index.ts', '**/*.d.ts'],
},
projects: [
{
// Everything except the Solid adapter test — the existing esbuild
// pipeline (React automatic JSX) is untouched.
test: {
...shared,
name: 'node',
include: ['test/**/*.test.{ts,tsx}'],
exclude: [
'test/tanstack-solid-router.test.ts',
'test/solid-router.test.ts',
'test/browser/**',
],
},
},
{
// The Solid tests are JSX-free and import the *precompiled* builds:
// `@tanstack/solid-router`/`@solidjs/router`'s `import` condition and
// `solid-js`'s `browser` condition both ship ready-to-run solid-js/web
// calls, so no Solid compiler is needed — only these resolve conditions.
// Inlining the packages routes them through Vite's transform so the
// conditions apply (externalized deps would resolve via Node's `node`
// condition → the server build). Scoped to this project, so the
// React/Vue suites are untouched.
resolve: {
conditions: ['browser', 'development', 'module', 'node', 'import', 'default'],
},
test: {
...shared,
name: 'solid',
include: ['test/tanstack-solid-router.test.ts', 'test/solid-router.test.ts'],
server: {
deps: { inline: [/solid-js/, /@tanstack\/solid-router/, /@solidjs\/router/] },
},
},
},
],
},
});