feat: unit tests (48 passing) and documentation#9
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 handlingsession.test.ts— LocalStorage adapter, NoopAdapter, SessionStore TTLtodo-tool.test.ts— add/list/complete/remove operations, validationtypes.test.ts— type compilation checksBackend (25 tests)
health.test.ts— health check endpointauth.test.ts— BYOK pass-through, managed key lookup, empty token rejectionfetch.test.ts— URL proxy, SSRF protection (localhost, private IPs)email.test.ts— email queuing, validationescalate.test.ts— ticket creation, transcript validationadmin.test.ts— admin auth, key CRUDkb.test.ts— R2 knowledge base get/put, admin authDocumentation
Also fixed
tsc --noEmitinstead ofwrangler deploy --dry-runvitest/globalsto both tsconfigs for type-safe test globals