Skip to main content
Automation
DEFINITION

What is Test Runner?

A test runner is the tool that finds your test files, executes the tests (handling setup, teardown, and order), and reports the results, the engine that actually drives a test run, as opposed to the libraries that make assertions or create mocks.

Free to start · 7-day trial on paid plans

IN DEPTH

In depth.

When you run your tests, something has to discover them, run each one, manage hooks (setup/teardown), handle async, isolate tests from each other, collect pass/fail outcomes, and produce a report. That something is the test runner. Examples include pytest (Python), Jest and Mocha and Vitest (JavaScript), JUnit and TestNG (Java), and the runner inside Cypress or Playwright.

It is useful to separate concerns. Some tools are just runners (Mocha runs tests but you bring your own assertions via Chai and mocks via Sinon), while others are all-in-one (Jest and Vitest bundle the runner, assertions, mocking, and coverage). Understanding this clarifies why some stacks combine several libraries and others do not.

Key runner capabilities interviewers may probe include test discovery (how it finds tests), parallel and isolated execution, filtering/tagging to run subsets, watch mode for fast feedback, retry handling for flaky tests, and reporting/integration with CI. The runner is the operational heart of automated testing: it turns a pile of test files into executed, reported results.

WHY IT MATTERS

Why interviewers ask about this.

Knowing what a test runner does, and how it differs from assertion and mocking libraries, signals you understand the anatomy of a test stack. It is the difference between naming tools and understanding how they fit together, which interviewers value.

EXAMPLE

Example scenario.

A team's JavaScript stack uses Vitest as the test runner: it discovers spec files, runs them in isolated, parallel workers with watch mode for fast local feedback, applies the configured coverage, and outputs a report the CI consumes, all the orchestration around the actual assertions in each test.

TIP

Interview tip.

Define a test runner as the tool that discovers, executes (with setup/teardown, isolation, async handling), and reports on tests. Distinguish runner-only tools (Mocha) from all-in-one frameworks (Jest, Vitest) that also bundle assertions and mocking, and mention capabilities like parallelism, filtering, watch mode, and CI reporting.

FAQ

Frequently asked questions.

What is the difference between a test runner and a test framework?

A test runner specifically discovers, executes, and reports on tests. A test framework is often broader, it may bundle the runner plus assertions, mocking, and coverage (like Jest or Vitest). Some tools are runner-only (Mocha) and you add assertion/mocking libraries separately, so the line depends on the tool.

What does a test runner actually do?

It discovers test files, runs each test while managing setup/teardown hooks, isolation, ordering, and async handling, supports filtering or tagging to run subsets, often offers parallel execution and watch mode, handles retries for flaky tests, and collects results into a report that humans and CI can consume.

Related Resources

Dive deeper with these related interview prep pages.

FREE TOOLS  /  no signup

Free QA career tools, no account needed

Instant and private, everything runs in your browser. Try them before you sign up.

EXEC.NOW

Ready to Ace Your QA Interview?

Practice explaining test runner and other key concepts with our AI interviewer.

Join 1,200+ QA engineers already practicing with AssertHired.

Start your free QA interview
FREE.TO.START  ·  7.DAY.TRIAL ON PAID PLANS
Written by Aston Cook, Senior QA EngineerLast updated May 2026