Skip to content

test(reports): add vitest and cover comparison-window logic#47

Merged
WhiteMuush merged 1 commit into
mainfrom
test/reports-deltas
Jun 16, 2026
Merged

test(reports): add vitest and cover comparison-window logic#47
WhiteMuush merged 1 commit into
mainfrom
test/reports-deltas

Conversation

@WhiteMuush

Copy link
Copy Markdown
Owner

What

  • Extract windows() (report comparison-period logic) into a prisma-free module so it can be imported without instantiating the Prisma client.
  • Add vitest and cover both branches: explicit date range (equal-length prior window, full end-of-day, single-day range) and the trailing-30-days fallback (contiguous prior window, one-sided bounds).
  • Add a Test job to CI and require it in the aggregate ci gate.

Why

The report deltas depend on windows() to derive current and prior periods, but nothing tested it and CI ran no unit tests. Closes the first gap flagged in the post-merge analysis.

Verification

npm test (6 passing), npm run lint -- --max-warnings 0, npx tsc --noEmit all green locally.

The report deltas relied on windows() to derive the current and prior
comparison periods, but nothing tested it and CI ran no unit tests.

- Extract windows() into a prisma-free module so it can be imported
  without instantiating the Prisma client.
- Add vitest and cover the explicit-range and trailing-30-days branches,
  including single-day ranges and one-sided bounds.
- Add a Test job to CI and require it in the aggregate ci gate.
@WhiteMuush WhiteMuush merged commit 6b80606 into main Jun 16, 2026
11 checks passed
@WhiteMuush WhiteMuush deleted the test/reports-deltas branch June 16, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant