Skip to content

Instantly share code, notes, and snippets.

@robertknight
robertknight / istanbul.md
Last active December 23, 2023 20:01
How Istanbul works

Istanbul Notes

These are some notes I made while reviewing hypothesis/client#156 to understand how Istanbul works

Istanbul instruments code in order to generate code coverage metrics for tests by adding code to record lines, statements etc. that are executed.

It adds a global __coverage__ variable to the generated code which is a map from file path to coverage information. The code for each module is then augmented with: