Summary
Zero tests exist. For a tool that handles private keys, signing, and publishing — this is a gap that needs filling before we add more features.
Scope (start small, grow)
Unit tests (Vitest)
lib/nostr.ts — event building, relay publishing, npub encoding
lib/markdown.ts — HTML↔Markdown conversion
lib/signer.ts — signing interface
types/nostr.ts — type validation
Integration tests
- Auth flow: NIP-07, NIP-46 connection, nsec import
- Publish flow: article event creation, relay selection, publish result handling
- Draft persistence: save/restore from localStorage
Component tests (React Testing Library)
- Editor: content input, draft auto-save
- PublishModal: relay selection, publish trigger
- ArticleReader: article rendering, comment loading
Setup
- Vitest (already Vite-based, zero config needed)
- React Testing Library for component tests
- Mock nostr-tools relay connections
Acceptance Criteria
Summary
Zero tests exist. For a tool that handles private keys, signing, and publishing — this is a gap that needs filling before we add more features.
Scope (start small, grow)
Unit tests (Vitest)
lib/nostr.ts— event building, relay publishing, npub encodinglib/markdown.ts— HTML↔Markdown conversionlib/signer.ts— signing interfacetypes/nostr.ts— type validationIntegration tests
Component tests (React Testing Library)
Setup
Acceptance Criteria
npm testruns and passes