Files
dsh-market/vitest.config.ts
Liu Wenjie a7e3bf9622 fix(net): carry our own dispatcher on a direct fetch (#742)
Node 22's global fetch reads the legacy undici dispatcher. The host's
first undici 8 import (web_fetch) replaces it, and gzip catalog bodies
then fail JSON.parse for the rest of the process. A proxied request
already passed a dispatcher; a direct one now does the same.
2026-09-27 13:45:18 +08:00

24 lines
931 B
TypeScript

import { defineConfig } from 'vitest/config'
// Unit lane: fast, no network, no real pnpm. The real-pnpm matrix lives in
// tests/*.compat.spec.ts and runs through vitest.compat.config.ts instead
// (`npm run test:compat`).
export default defineConfig({
test: {
// Strips the developer's proxy variables first: with one exported, the
// fetch stubs below marketFetch never see a request (tests/setup/no-proxy.ts).
setupFiles: ['tests/setup/no-proxy.ts', 'tests/setup/undici-fetch.ts'],
include: ['tests/**/*.spec.ts', 'tests/**/*.spec.tsx'],
exclude: ['tests/**/*.compat.spec.ts', '**/node_modules/**'],
pool: 'forks',
testTimeout: 20_000,
server: {
deps: {
// ui-primitives (and its katex dependency) ship raw .css imports;
// inlining routes them through vite's transform for the jsdom lane.
inline: [/@deepseek-ai\/dsh-client-/, /katex/],
},
},
},
})