JavaScript TypeScript testing patterns reference
Testing Patterns Reference is a JavaScript and TypeScript quick reference in Addy Osmani's agent-skills that shows the test-driven-development skill's principles in code. It is for developers and coding agents such as Codex writing tests with Jest, React Testing Library, Supertest and Playwright.
What it does
It covers Arrange-Act-Assert structure, test naming, common assertions, mocking patterns, React component tests, API and integration tests, Playwright E2E tests and test anti-patterns.
How to use it
Keep it next to the test-driven-development skill so the agent can copy the right pattern.
Requirements and limits
The syntax and tooling are specific to JS and TS. In another stack the same principles apply with the repository's own test framework and commands.
More in Reference docs and the Codex library.
What it covers
- Table of Contents
- Test Structure Arrange-Act-Assert
- Test Naming Conventions
- Common Assertions
- Mocking Patterns
- Mock Functions
- Mock Modules
- Mock at Boundaries Only
- React/Component Testing
- API / Integration Testing
The full text is in the members library
Book a call and we will give you access to the full Codex library: every entry in full, search by meaning, copy and download.
Source and license
Source: https://github.com/addyosmani/agent-skills/blob/main/references/testing-patterns.md
Author: addyosmani, Addy Osmani agent skills. License: MIT.