test runner
A tool that finds test files, runs the tests in them and reports which passed and which failed.
In more detail
Popular test runners include Jest, Vitest and Mocha for JavaScript and pytest for Python. A runner decides which tests to collect, in what order to run them and how to report the results. It usually exits with a non-zero code when any test fails, so build pipelines can stop.
Example
Node.js has one built in: node --test finds and runs test files, and node:test provides test(), describe(), it(), mocks and hooks.Related terms
- unit test — An automated check of one small piece of code, such as a single function, that runs quickly and on its own.
- assertion — A check that a condition is true, which stops a test or program with a failure if it is false.
- test reporter — The part of a test runner that formats results, for people (such as a spec list) or for tools (such as TAP or JUnit XML).
- pytest — A popular Python testing framework that finds test functions automatically and reports failures with detailed comparisons.
- test collection — The step where pytest searches files and names to decide which tests exist before running any of them.
- test framework — A library and set of conventions for writing, organising and running automated tests in a language.
Taught in
- Native Test Runner: node:test & node:assert/strict — Node.js Internals & Backend Services
- The Cost And Value Of A Test — Automated Testing, TDD & Quality Engineering
- Introducing pytest — Automated Testing, TDD & Quality Engineering