Awesome Reviewers

Verification · Testing · Unit and integration tests

Unit tests

Fast, isolated tests per function or class.

How to build it

  1. Write one test file per module with cases for each public function or class.
  2. Mock only the external boundaries of each unit under test.
  3. Run the test command in CI on every pull request.

Signals in a repository

  • tests/ or *_test.* files next to the source they cover.
  • A test script in package.json, pyproject.toml or a Makefile that runs the runner.
  • A CI workflow step that runs the test command on pull requests.

In practice

193 repositories run a tool for this check in the scanned set.

  • pytest · 77 repos
  • jest · 38 repos
  • vitest · 91 repos
  • unittest · 20 repos
  • mocha · 10 repos
  • node-test · 35 repos
  • go-test · 29 repos
  • cargo-test · 44 repos

Examples