Three generator fixes:
- templates/feature/vitest.config.ts.hbs lacked an include for
.test.{ts,tsx}; the node base only includes .test.ts, so scaffolded
UI component tests never executed
- gen event consume emitted an unguarded bus.subscribe although
ctx.bus is optional in BindContext — now wrapped in if (bus) {}
- e2e repo clones now exclude /dist and /.next build outputs, and
every dep-stripping e2e strips the scaffolded package from EVERY
workspace package.json via globSync instead of a hardcoded dependent
list that drifts as packages gain or drop the dependency
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
36 lines
1.4 KiB
Handlebars
36 lines
1.4 KiB
Handlebars
import path from "node:path";
|
|
import { mergeConfig } from "vitest/config";
|
|
import { nodeVitestConfig } from "@repo/core-typescript/vitest.base.node";
|
|
import {
|
|
DEFAULT_COVERAGE_BANDS,
|
|
vitestThresholdsFromBands,
|
|
} from "@repo/core-shared/conformance/coverage";
|
|
|
|
// Coverage thresholds derived from DEFAULT_COVERAGE_BANDS via the shared
|
|
// helper (ADR-020). The feature.manifest.ts `coverage.bands` section
|
|
// declares these for boot-time `assertFeatureConformance`. Edit the
|
|
// manifest when adjusting per-feature bands.
|
|
export default mergeConfig(nodeVitestConfig, {
|
|
test: {
|
|
// The node base only includes .test.ts; UI tests are .test.tsx files
|
|
// that opt into jsdom per-file via the @vitest-environment docblock.
|
|
include: ["src/**/*.test.{ts,tsx}"],
|
|
coverage: {
|
|
exclude: [
|
|
// DI bootstrap — wires InversifyJS at app startup; not unit-testable
|
|
"src/di/bind-production.ts",
|
|
// Pure TypeScript interface files — not executable
|
|
"src/application/repositories/**",
|
|
// Payload CMS templates — declarative data, tested via integration
|
|
"src/integrations/cms/**",
|
|
// React Query option builders — integration-tested in apps
|
|
"src/ui/**",
|
|
],
|
|
thresholds: vitestThresholdsFromBands(DEFAULT_COVERAGE_BANDS),
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: { "@": path.resolve(__dirname, "./src") },
|
|
},
|
|
});
|