© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
D. IrvineBuild Your Own Test Frameworkhttps://doi.org/10.1007/978-1-4842-9247-1_8

8. Focusing on Specific Tests

Daniel Irvine1  
(1)
London, UK
 

The core of our system is essentially complete. We can now write complete test suites and get beautiful reports on-screen.

But there’s one BIG unanswered question that’ll require a serious rethink:

How do we a run a single test?

This is known as focusing on one (or more) test or describe block. The test runner does this by only running tests that are created using it.only rather than it. If no tests are marked as .only, then we run all the tests, just as we do now.

This applies to describe too: if one or more describe

Get Build Your Own Test Framework: A Practical Guide to Writing Better Automated Tests now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.