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.
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 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 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.
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.
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 Terms
Explore related glossary terms to deepen your understanding.
Related Resources
Dive deeper with these related interview prep pages.
Free QA career tools, no account needed
Instant and private, everything runs in your browser. Try them before you sign up.
QA Resume Checker
Instant 0-100 score on automation keywords, impact, and ATS formatting.
QA Cover Letter Generator
A tailored 3-paragraph QA cover letter from your resume and a job post.
QA Application Tracker
Drag-and-drop kanban to track every QA application from Applied to Offer.
QA Take-Home Test Generator
A realistic take-home assignment with a scenario, tasks, and a rubric.
QA LinkedIn Headline Generator
A recruiter-searchable headline, About section, and skills list.
QA STAR Story Builder
Structure a QA behavioral answer with the STAR method and instant checks.
QA Bug Report Generator
Build a clean, reproducible bug report for Markdown, Jira, or plain text.
Boundary Value Analysis Generator
Generate boundary value and equivalence partitioning test cases from a range.
QA Metrics Calculator
Calculate DRE, defect leakage, defect density, and pass rate with interpretation.
QA Test Plan Generator
Build a structured test plan (scope, approach, criteria, risks) in Markdown.
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