Cloud Parts

Test runners

Find the tests, run them (usually in parallel), and report the results with an exit code CI can act on.

How they work

A runner collects tests by convention and runs them in isolation. pytest looks for test_*.py or *_test.py files and runs test-prefixed functions; the pytest-xdist plugin spreads them over one worker process per CPU. Vitest’s default pattern matches *.test.* and *.spec.* files, and it runs files in parallel, each in its own child process by default (or a worker thread), with tests inside a file running one after another unless marked concurrent.

Most runners bundle what tests need: assertions, mock functions and spies, snapshot testing (the output is saved to a file that is committed and reviewed, and the test fails when it changes), coverage, and a watch mode. Vitest’s watch mode follows the module graph and reruns only the tests that import a changed file, the way Vite’s hot module replacement updates only the changed module.

Pick the runner your ecosystem expects: pytest in Python, Vitest or Jest in JavaScript and TypeScript. Vitest keeps a Jest-compatible API, so most Jest suites run on it with few changes.

Technologies

What all automated testing have in common →

Sources

Improve this page on GitHub