© 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_3

3. Grouping Tests

Daniel Irvine1  
(1)
London, UK
 

In this chapter we’ll add the describe function to group our tests. This function is a core mechanism for organizing tests.

You’ll learn
  • The mechanisms in place for organizing tests

  • How to implement the describe function

  • How to build a test report that contains organizational information

By the end of the chapter, you’ll have a deep understanding of how all unit test projects are structured.

The Basics of Unit Test Organization

The test script file you’ve been working with, test/tests.mjs, already has two types of organization.

First, ...

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.