liveBook · Manning

Test runner

As explained in The Art of Unit Testing 3e

Software that executes tests, reports their results, and proceeds between test cases according to its execution rules.

A test runner finds tests in your code, executes them automatically, reports their status, and helps reveal why failures occurred. It removes the repetitive work of manually running tests. section 2.3

A runner typically helps you:

  • Execute one test or an entire test suite. section 2.3
  • Repeat tests quickly and consistently, making it easier to catch small but significant bugs. section 2.3
  • Review counts, failed tests, failure reasons, code locations, and sometimes stack traces. section 2.3

Running a group of tests with Jest

Jest combines a test runner with a test library, assertion library, and reporter. Use its --testPathPattern flag to run a selected group of tests rather than every test. section 2.2 section 2.12

Figure 2.4 Unit tests are written as code, using libraries from the unit testing framework. The tests are run from a test runner inside the IDE or through the command line, and the results are reviewed through a test reporter (either as output text or in the IDE) by the developer or an automated build process.
02-04

Trace the workflow from tests written as code, through runner execution in an IDE or command line, to results reviewed by a developer or automated build process. section 2.3

How The Art of Unit Testing 3e covers it

How deep it goes
Explains test identification, automatic execution, status reporting, and failure details without describing runner internals.
Examples
Uses Jest, command-line or IDE execution, grouped tests, and reports containing counts, failures, reasons, locations, and stack traces.
What you can do after
Operate/configure Jest to run individual, complete, or path-selected test groups and inspect the resulting failures.
How it connects
Connects test runners with test frameworks, assertions, test reporters, IDEs, command lines, and automated build processes.

Also explained in

Compare how 5 books explain test runner →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of Unit Testing 3e. The section links point to the parts of the book it draws on.