write-tests

Installation
SKILL.md

Write Tests

Tests are not production code. They are documentation — each one is a tiny executable spec that says "this system does X." A reader should grasp the intent in seconds. A failure should point to exactly one broken behavior, not leave you going through a 40-line test body.

Workflow

Follow these steps in order before writing any test code.

  1. Decide the framework. Testing a function's return value, side effects, or module interactions → Vitest (lives under packages/<name>/test/). Testing that a real HTTP request to a running app produces the correct Sentry envelope → Playwright (lives under dev-packages/e2e-tests/test-applications/<app>/tests/).

  2. Read 2–3 existing test files in the target test/ directory. Specifically note:

    • Which vi.mock style they use (string path or import form)
    • What cleanup they do in beforeEach (clearAllMocks vs restoreAllMocks)
    • How they import the module under test (../../src/... vs @sentry/...)
Related skills
Installs
2
GitHub Stars
8.6K
First Seen
13 days ago