Files
dsh-context/vitest.config.ts
T
bowenliang123 537e53a56a refactor(comments): trim comments in the build configs
Drop the restated build narration in tsdown.config.ts and vitest.config.ts and
keep only the decisions a reader cannot recover from the code: the platform
module subset, the pinned native toolchain, the virtual-id suffix rule, the
unminified/typed host half, and the compat lane's preconditions. Stop claiming
to "mirror" the harness lists, which these are subsets of.
2026-10-10 00:26:24 +08:00

58 lines
2.0 KiB
TypeScript

import { defineConfig } from 'vitest/config'
// Specs import src/ directly, never the built lib/, so the suite needs no build step and coverage reflects what ships.
export default defineConfig({
test: {
reporters: ['dot'],
projects: [
{
test: {
name: 'host',
include: ['tests/host/**/*.spec.ts', 'tests/shared/**/*.spec.ts'],
environment: 'node',
},
},
{
// The inlined primitives dist references a sourcemap it does not ship; vite's warning is noise.
logLevel: 'error',
test: {
name: 'client',
include: ['tests/client/**/*.spec.ts'],
environment: 'jsdom',
setupFiles: ['tests/client/setup.ts'],
server: {
deps: {
// The primitives dist imports .module.css; inlining lets vite transform it (externalized Node ESM would reject the .css).
inline: ['@deepseek-ai/dsh-client-ui-primitives'],
},
},
},
},
{
// Exercises the BUILT plugin and skips cleanly when lib/ is absent. The matrix also needs a dsh checkout (env DSH_REPO), and its first run per baseline installs the tag's vendored cordis into .tmp/compat — hence the timeout.
test: {
name: 'compat',
include: ['tests/compat/**/*.spec.ts'],
environment: 'node',
testTimeout: 120_000,
},
},
],
coverage: {
provider: 'v8',
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/**/*.d.ts',
// Pure type declarations: no runtime surface to instrument.
'src/shared/types.ts',
'src/host/compat.ts',
],
thresholds: { perFile: true, statements: 100, branches: 100, functions: 100, lines: 100 },
reporter: ['text', 'html'],
// The text table lists only files below 100%; an empty table means full coverage.
skipFull: true,
reportsDirectory: './coverage',
},
},
})