learning_ai_common_plat/dashboards/tracker-web/vitest.config.ts
saravanakumardb1 f2dfddf944 feat(tracker-web): data-viz overview with charts + KpiCards (UX-4)
Add @bytelyst/charts + @bytelyst/data-viz as workspace:* deps (minimal
importer link entries in the lockfile). Replace the badge-pill breakdowns
on /dashboard with KpiCards (total/open/in-progress/done) and a dynamically
imported chart surface: Donut for By Status + By Type (centered total) and
a BarChart for By Priority, coloured from the bridged --bl-chart-* palette.

Pure transforms live in src/lib/overview-charts.ts (finite-coerced, no NaN
reaches the SVG); the heavy chart surface is split into overview-charts.tsx
and loaded via next/dynamic (ssr:false) to keep it out of the route bundle.
Add overview-charts.test.tsx rendering the surface with mocked stats via
react-dom/server (no NaN in paths) + transform unit tests; dedupe react in
vitest so the SSR render uses a single React instance.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-29 06:51:39 -07:00

41 lines
1.1 KiB
TypeScript

import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
environment: 'node',
globals: true,
exclude: ['e2e/**', 'node_modules/**'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/**',
'.next/**',
'coverage/**',
'**/*.test.ts',
'**/*.test.tsx',
'**/*.config.*',
'**/e2e/**',
],
// Vitest reads these keys directly under `thresholds` (the legacy `global`
// nesting is ignored by the v8 provider and silently disables enforcement).
thresholds: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
// Workspace packages (e.g. @bytelyst/charts) can resolve their own React
// copy via the pnpm store; dedupe so SSR render tests use a single React
// instance (avoids the "Invalid hook call" dual-package hazard).
dedupe: ['react', 'react-dom'],
},
});