write-tests
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.
-
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 underdev-packages/e2e-tests/test-applications/<app>/tests/). Testing Node SDK instrumentation against real envelope output → node-integration-tests (lives underdev-packages/node-integration-tests/suites/).Parameterization differs by framework — pick the right one: