chore: implement test coverage across the monorepo #11

Closed
opened 2026-03-07 11:13:49 -08:00 by hikari · 0 comments
Owner

Description

The project currently has no test coverage. This needs to be addressed with a proper test suite using Vitest and @vitest/coverage-v8, targeting 100% code coverage.

Scope

packages/types

  • Unit tests for any utility functions or type guards

apps/api

  • Unit tests for all route handlers, data files, and utility functions
  • Mock Prisma/MongoDB where needed

apps/web

  • Investigate appropriate test setup for Vite/React (may need @vitest/ui or similar)
  • Unit tests for utilities (e.g. format.ts, tick engine logic)
  • Component tests as appropriate

Acceptance Criteria

  • Vitest configured in each applicable package with @vitest/coverage-v8
  • Coverage thresholds set to 100% for statements, branches, functions, and lines
  • Test files live in test/ directories (not alongside source files)
  • CI pipeline updated to run tests after build: dependency-pin-check → install → lint → build → test
  • All tests pass cleanly with no warnings

Configuration Reference

// vitest.config.ts
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    coverage: {
      provider: "v8",
      include: ["src/**/*.ts"],
      exclude: ["src/types/**/*.ts"],
      thresholds: {
        statements: 100,
        branches: 100,
        functions: 100,
        lines: 100,
      },
    },
    include: ["test/**/*.spec.ts"],
  },
});

This issue was created with help from Hikari~ 🌸

## Description The project currently has no test coverage. This needs to be addressed with a proper test suite using **Vitest** and **@vitest/coverage-v8**, targeting **100% code coverage**. ## Scope ### `packages/types` - Unit tests for any utility functions or type guards ### `apps/api` - Unit tests for all route handlers, data files, and utility functions - Mock Prisma/MongoDB where needed ### `apps/web` - Investigate appropriate test setup for Vite/React (may need `@vitest/ui` or similar) - Unit tests for utilities (e.g. `format.ts`, tick engine logic) - Component tests as appropriate ## Acceptance Criteria - Vitest configured in each applicable package with `@vitest/coverage-v8` - Coverage thresholds set to 100% for statements, branches, functions, and lines - Test files live in `test/` directories (not alongside source files) - CI pipeline updated to run tests after build: `dependency-pin-check → install → lint → build → test` - All tests pass cleanly with no warnings ## Configuration Reference ```typescript // vitest.config.ts import { defineConfig } from "vitest/config"; export default defineConfig({ test: { coverage: { provider: "v8", include: ["src/**/*.ts"], exclude: ["src/types/**/*.ts"], thresholds: { statements: 100, branches: 100, functions: 100, lines: 100, }, }, include: ["test/**/*.spec.ts"], }, }); ``` ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-03-08 15:53:40 -07:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/elysium#11