Our great sponsors
-
lerna
:dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
In this post join me as I will be adding an aggregated unit test code coverage report for my Pedalboard monorepo. Monorepos contain many packages, and for each you (should) have tests for and a way to generate a code coverage report from them, but what if you’d like to have a single place where you can see the overall coverage status of the entire monorepo? Let me show you how…
It is a good time to mention that my Pedalboard monorepo uses the Jest testing framework. The first step is to add a script at the root project level, with which I can run my test coverage for all the nested packages. Should be straightforward, using Lerna for that. Here is how my scripts look like now:
So let’s see if nyc (the code coverage generator) can help with that. Hmm… this documentation seems interesting! So basically what I understand from it is that I need to collect all the reports from the different packages and then run the nyc report over it. The flow should be like this: