Standardize tests on vitest #11
Loading…
Reference in a new issue
No description provided.
Delete branch "mailship-clt-standardize-tests-on-vitest-ddc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mailship-clt
Adopt vitest as the standard test framework, replacing hand-rolled assert scripts across 4 test files. This aligns with the nostr/coracle ecosystem (welshman, coracle/harness, NDK all use vitest).
vitestas a dev dependency (pnpm add -D vitest), createdvitest.config.tswithglobals: true, and addedtest/setup.tsto supply required env vars at module load time.describe/it/expectas.test.ts:test/digest-template.test.ts— 4 tests verifying{{brandAccent}}usage in the MJML templatetest/normalize-relay-url.test.ts— 3 tests for guardednormalizeRelayUrlcalls (imports from@welshman/utilinstead of an absolute pnpm path)test/reschedule-on-frequency-change.test.ts— 3 tests for cron rescheduling on frequency change (imports fromsrc/instead ofdist/)test/event-arrival-race.test.ts— 5 tests for the event-arrival race fix (captures fetch IDs before insert to verify delete-by-id, not timestamp-based delete)test/web-ui.test.js— dead test for the removed web UI (PR #1).package.json: Added"test:unit": "vitest run";"test"unchanged (bash E2E).script/checks: Addedpnpm test:unitafter build.README.md: Updated Testing section to documentpnpm test:unitandpnpm test(integration).The integration test suite (
test/integration.sh,test/cors.test.sh) is untouched.How to test: Run
pnpm test:unit(orbash script/checksfor the full pipeline — typecheck, lint, build, and unit tests). All 4 test files and 15 tests should pass.