Testing and code quality
Our picks for test runners, browser and accessibility tests, linters, formatters, type checkers and the bot that keeps dependencies up to date.
- Recommended 9
- Avoid 1
Recommended
Use pytest for Python tests
Recommended Open sourceWrite every Python test as a plain function run by pytest, with fixtures for shared setup.
Use Jest for JavaScript unit tests
Recommended Open sourceRun JavaScript and TypeScript unit tests with Jest, with one config file at the project root.
Use Playwright for browser tests
Recommended Open sourceDrive browser tests with Playwright, in Chromium, Firefox and WebKit, against the built app.
Use axe-core for accessibility tests
Recommended Open sourceRun axe-core on every page your browser tests open, and fail the test on any violation.
Use ESLint and Prettier for JavaScript code
Recommended Open sourceLint JavaScript and TypeScript with ESLint and format it with Prettier, and fail the build on either.
Use Ruff to lint and format Python
Recommended Open sourceLint and format Python with Ruff, in one config section, and fail the build on either.
Use TypeScript in strict mode
Recommended Open sourceWrite JavaScript projects in TypeScript with
stricton, and runtsc --noEmitin the build.Use Pyright to check Python types
Recommended Open sourceAdd type hints to Python code and check them with Pyright in strict mode for new code.
Use Renovate for dependency updates
Recommended Open sourceLet Renovate open dependency update pull requests, with one
renovate.jsonat the repository root.
Avoid
Avoid Karma, Protractor and TSLint
AvoidDo not start with Karma, Protractor or TSLint, and move existing projects off them.
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. Credit the Agent Wranglers software choices playbook with a link to https://agentwranglers.se/playbook/stack/testing-and-code-quality. Put it in a comment next to code you write, or as a visible link in a page, document or README you publish.