Skip to content

test(web): setup Vitest and add unit tests for lib utilities and auth store - #104

Merged
rodriguecyber merged 1 commit into
Open-Source-Kigali:developfrom
docile-imbereyemaso:test/issue-55-setup-web-vitest
Aug 11, 2026
Merged

test(web): setup Vitest and add unit tests for lib utilities and auth store#104
rodriguecyber merged 1 commit into
Open-Source-Kigali:developfrom
docile-imbereyemaso:test/issue-55-setup-web-vitest

Conversation

@docile-imbereyemaso

@docile-imbereyemaso docile-imbereyemaso commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Establishes a testing floor and baseline test suite for the apps/web workspace using Vitest.

Specifically, this PR:

  • Installs Vitest as a dev dependency in apps/web.
  • Adds the test script (vitest run) to apps/web/package.json.
  • Adds unit tests for pure utility functions in lib/format.ts and lib/metrics.ts
  • Adds unit tests for the session state machine in stores/auth.ts.
  • Adds a Test web step to .github/workflows/node.yml to enforce web test verification on PRs.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Docs
  • Infrastructure / CI
  • Breaking change

Areas touched

  • apps/server (NestJS)
  • apps/web (React / Vite)
  • apps/agent (Go)
  • packages/protocol (shared WebSocket contracts)
  • infrastructure / .github/workflows
  • docs

Related issues

Closes #55

How to test

  1. Run npm run test --workspace=@docksight/web locally.
  2. Check the CI checks on this PR to confirm that the Test web step in .github/workflows/node.yml executed and passed.

Checklist

  • Change is focused and stays within the existing modular monolith boundaries.
  • Ran the relevant checks locally (see below).
  • Updated docs under docs/ if module boundaries or the protocol changed.
  • Added an ADR under docs/decisions/ if this is a larger architectural change.
Local checks
# packages/protocol must be built first — apps/server and apps/web
# import it from its dist output.
npm run build --workspace=@docksight/protocol
npm run test  --workspace=@docksight/protocol

npm run build --workspace=@docksight/server
npm run lint  --workspace=@docksight/server
npm run test  --workspace=@docksight/server

npm run build --workspace=@docksight/web
npm run lint  --workspace=@docksight/web
npm run test  --workspace=@docksight/web

@rodriguecyber
rodriguecyber merged commit 4ac7941 into Open-Source-Kigali:develop Aug 11, 2026
1 check passed
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.

The web app has no tests and no test tooling

2 participants