Appearance
Testing
Patterns and tools for testing JavaScript applications across Node.js and browser environments.
Topics
- JavaScript Testing: Testing patterns using the Node.js test runner and
node:assert/strict— test exports, signatures, and observable behaviors. Use when writing or running tests in Node.js. - Playwright Browser Testing: End-to-end browser testing with Playwright and Chromium, including GitHub Actions CI setup. Use when tests need a real browser for navigation, clicks, or screenshots.
- In-Browser Testing: Lightweight in-browser test runner with HTML fixtures and method stubs, plus a Playwright CI bridge. Use when tests should live in the same file as the code being tested.
- Playwright Screenshots: Retina-quality screenshots with custom viewports and tooltip capture. Use when capturing polished screenshots for documentation or design review.
- Playwright Mouse Cursor: Inject a visible mouse cursor overlay into Playwright pages. Use when screenshots, recordings, or demos need to show cursor position.
- Screenshot Diff Testing: Visual regression testing that commits screenshots to git and uses
git difffor pass/fail. Use when verifying visual output changes with human approval. - Evals: Testing agent behaviors with simulated user conversations, structured grading, and eval reports. Use when writing or running evals.