Verification · Testing · Unit and integration tests
Unit tests
Fast, isolated tests per function or class.
How to build it
- Write one test file per module with cases for each public function or class.
- Mock only the external boundaries of each unit under test.
- 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 reposjest· 38 reposvitest· 91 reposunittest· 20 reposmocha· 10 reposnode-test· 35 reposgo-test· 29 reposcargo-test· 44 repos
Examples
-
freeCodeCamp/freeCodeCamp ·
vitestvitest run -
facebook/react ·
cargo-testcargo test --workspace -
nousresearch/hermes-agent ·
pytestpytest ${args[@]} -
TheAlgorithms/Python ·
pytestpytest --iterations=8 --parallel-threads=auto --ignore-gil-enabled --ignore=computer_vision/flip_augmentation.py --ignore=computer_vision/harris_corner.py --ign -
microsoft/vscode ·
mochamocha test/unit/node/index.js --delay --ui=tdd --exit