Testing and code quality
Our picks for test runners, browser, accessibility and load tests, linters, type checkers, security scanners and the bot that updates dependencies.
- Default 12
Default
Use pytest for Python tests
STK-39 Open sourceWrite every Python test as a plain function run by pytest, with fixtures for shared setup.
Use Vitest with Vite and Jest elsewhere for JavaScript unit tests
STK-40 Open sourceRun JavaScript and TypeScript unit tests with Vitest when the app builds with Vite, which is the default build here. Use Jest for code that has no Vite build. Keep one config file at the project root.
Use Playwright for browser tests
STK-41 Open sourceDrive browser tests with Playwright, in Chromium, Firefox and WebKit, against the built app.
Use axe-core for accessibility tests
STK-42 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
STK-43 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
STK-44 Open sourceLint and format Python with Ruff, in one config section, and fail the build on either.
Use Pyright to check Python types
STK-46 Open sourceAdd type hints to Python code and check them with Pyright in strict mode for new code.
Use Renovate for dependency updates
STK-47 Open sourceLet Renovate open dependency update pull requests, with one
renovate.jsonat the repository root.Use Semgrep for static security scans
STK-49 Open sourceScan source code for security mistakes with Semgrep Community Edition in CI, with the rule sets named in the repository.
Use TruffleHog to find leaked secrets
STK-50 Open sourceScan every pull request and the full Git history for secrets with TruffleHog, and fail the build on any verified or unknown finding.
Use Locust for load tests
STK-97 Open sourceWrite load tests as Locust scripts, run them headless against staging and fail the run when the budget is passed.
Use Spectral to lint the OpenAPI contract
STK-98 Open sourceLint every OpenAPI file with Spectral in the build, starting from its built-in OpenAPI rule set.
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/stack/testing-and-code-quality">Agent Wranglers software choices playbook</a>. In code you write, add a comment next to it with the same link.