Skip to content

feat: unit tests (48 passing) and documentation#9

Merged
OpenCodeEngineer merged 1 commit into
mainfrom
feat/tests-and-docs
Apr 19, 2026
Merged

feat: unit tests (48 passing) and documentation#9
OpenCodeEngineer merged 1 commit into
mainfrom
feat/tests-and-docs

Conversation

@OpenCodeEngineer

Copy link
Copy Markdown
Collaborator

Summary

Adds comprehensive unit tests and documentation for the webagent monorepo.

Tests (48 passing)

Widget (23 tests)

  • knowledge.test.ts — TF-IDF search scoring, caching, error handling
  • session.test.ts — LocalStorage adapter, NoopAdapter, SessionStore TTL
  • todo-tool.test.ts — add/list/complete/remove operations, validation
  • types.test.ts — type compilation checks

Backend (25 tests)

  • health.test.ts — health check endpoint
  • auth.test.ts — BYOK pass-through, managed key lookup, empty token rejection
  • fetch.test.ts — URL proxy, SSRF protection (localhost, private IPs)
  • email.test.ts — email queuing, validation
  • escalate.test.ts — ticket creation, transcript validation
  • admin.test.ts — admin auth, key CRUD
  • kb.test.ts — R2 knowledge base get/put, admin auth

Documentation

  • README.md — complete rewrite with features, quick start, config reference, architecture diagram, WebMCP docs
  • docs/skills.md — skill authoring guide with examples
  • docs/deploy.md — Cloudflare deployment guide, KB setup, CI/CD secrets, free tier limits

Also fixed

  • CI workflow: removed explicit pnpm version (conflicts with packageManager field)
  • Backend build: tsc --noEmit instead of wrangler deploy --dry-run
  • Added vitest/globals to both tsconfigs for type-safe test globals

Tests:
- Widget: 23 tests (knowledge TF-IDF, session store, todo tool, type checks)
- Backend: 25 tests (health, auth, fetch proxy, email, escalate, admin, KB)
- vitest + happy-dom for widget, vitest for backend
- All typecheck clean

Documentation:
- README: features, quick start, config reference, architecture diagram
- docs/skills.md: skill authoring guide with examples
- docs/deploy.md: Cloudflare deployment guide, KB setup, CI/CD secrets

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@OpenCodeEngineer OpenCodeEngineer merged commit d38c47c into main Apr 19, 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.

1 participant