# Testing

Use when adding, changing, deleting, or reviewing tests in Anarlog (TypeScript, Rust...

- Repository: https://github.com/fastrepl/anarlog (9738 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add fastrepl/anarlog --skill testing -g -a claude-code -y`
Codex: `npx skills add fastrepl/anarlog --skill testing -g -a codex -y`
Cursor: `npx skills add fastrepl/anarlog --skill testing -g -a cursor -y`
Gemini CLI: `npx skills add fastrepl/anarlog --skill testing -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add fastrepl/anarlog`

## Description

Use when adding, changing, deleting, or reviewing tests in Anarlog (TypeScript, Rust, or node --test scripts), deciding whether a change needs a test, fixing a failing test, or pruning test suites. Covers what is worth testing, what to leave untested, test budgets, and the test-weight report.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Testing

Use this skill when adding, changing, deleting, or reviewing tests in Anarlog, deciding whether a change needs a test, or pruning a test suite. Tests are code we pay for on every CI run and every refactor; keep the ones that catch real regressions and nothing else.

## Write a test when

- A bug was fixed: add one regression test that fails without the fix. One, not a matrix of neighbours.
- The behavior is observable by a user or another component: public APIs, tauri-specta bindings, OpenAPI contracts, MCP and CLI output, serializers and parsers, TipTap/ProseMirror JSON conversion.
- Losing it loses data or trust: SQLite migrations and desktop/mobile schema parity, CloudSync and E2EE, auth, billing and Stripe webhooks, permissions and RLS, recording and STT lifecycles.
- It is a real concurrency or recovery invariant: capture start/stop races, crash recovery, retry, cancellation, ordering between actors or tasks.
- It encodes release or store policy that a workflow edit could silently break (for example `scripts/desktop-release-provenance.test.mjs`).

## Do not write a test for

- CSS classes, DOM structure, exact copy, or log text, unless the text is a contract (CLI output parsed by another tool, i18n keys checked by CI).
- Mock call counts or call order when the observable result already proves the behavior.
- Private state, internal helpers already covered through their public caller, or trivial delegation.
- Framework or library behavior (React, TanStack, Tauri, Zustand, Tokio, serde).
- Constants, enum tables, type re-exports, or anything that mirrors source line by line.
- Package or file layout. Structural and import-boundary rules belong in oxlint/ESLint rules, not tests that read files from disk.
- `test.skip` / `#[ignore]` without a linked issue.

## Budget

The rest: https://github.com/fastrepl/anarlog/blob/HEAD/.agents/skills/testing/SKILL.md
