Skip to content

Add Vitest unit tests + CI step - #30

Merged
valeboth merged 1 commit into
mainfrom
feat/tests
Aug 26, 2026
Merged

Add Vitest unit tests + CI step#30
valeboth merged 1 commit into
mainfrom
feat/tests

Conversation

@valeboth

Copy link
Copy Markdown
Owner

Adds automated tests + runs them in CI.

  • Unit tests for the pure, bug-prone helpers: ids (join-code charset/length, UUID) and mappers (room deck/null parsing, profile prefs + safe handling of bad JSON). 4 tests, all passing.
  • npm test (vitest run) added to the CI checks on PRs.

Note: I tried route/integration tests via @cloudflare/vitest-pool-workers, but the current vitest@4 + pool combo is unstable (it dropped defineWorkersConfig and the pool runner errors as 'not supported'). Rather than ship a broken/flaky config, I kept reliable unit tests and left the integration harness as a follow-up (would need a known-good vitest+pool pin). The routes are already covered by manual E2E checks on each feature.

- unit tests for the pure, bug-prone helpers: ids (genJoinCode charset/length, genId
  UUID) and mappers (mapRoom deck/null parsing, mapProfile prefs + safe bad-JSON)
- 'npm test' (vitest run) added to the CI checks (PR -> main)

Note: route/integration tests via @cloudflare/vitest-pool-workers were attempted but the
current vitest 4 + pool combo is unstable (removed defineWorkersConfig / unsupported
runner); left as a follow-up. Unit tests: 4 passing.
@valeboth
valeboth merged commit f728d0c into main Aug 26, 2026
1 check failed
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