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

10. Reporting

Daniel Irvine1  
(1)
London, UK
 

Currently, the test runner’s reporting code is pretty fixed. There’s no way to configure it or switch it out. This might be a problem, for example, with sending output to a text file on a Continuous Integration (CI) environment, since text files don’t support ANSI escape codes.

In this chapter we’ll implement a system for supporting different output mechanisms for test reports. We’ll do this by writing a basic event dispatcher that will allow us to dispatch events to a reporter.

You’ll learn
  • How the observer pattern can be applied to ...

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.