Skip to content

Write package coverage data to JSON #1

Open
@kgryte

Description

@kgryte

Currently, coverage data is found in HTML files. To ease extraction and metrics, would be good to write coverage data to a JSON file.

The first time coverage data for a particular package is written to this repo, a JSON file should be created and committed. For subsequent coverage runs, coverage data should be appended to the JSON file to allow for tracking coverage over time.

JSON coverage data can then be rolled up/aggregated within namespaces to provide coverage metrics for an entire namespace.

The format of the coverage data can be condensed. E.g.,

[ <num_statements>, <total_statements>, <statements_percentage>, <num_branches>, <total_branches>, <branches, percentage>, ... ]

The condensed format should be explicitly documented.

May also be good to append coverage data to a CSV file, as well, for ease of use in other analysis tools.

Activity

vtushar06

vtushar06 commented on Jun 19, 2025

@vtushar06

Hi @kgryte sir,

This sounds like a great feature and a valuable addition to the project!
I’d love to contribute to this issue by implementing JSON coverage output and appending future results to the same file for historical tracking.

Just to clarify before I get started:
• Should the JSON file follow a naming convention (e.g., package-name.coverage.json)?
• Do you have a preferred directory for storing these JSON/CSV files?
• Is there already an example HTML file or coverage output format I can refer to while extracting data?

Once confirmed, I’ll get started with a PR for initial coverage data write logic and documentation of the condensed format.

Looking forward to your guidance!
@vtushar06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Write package coverage data to JSON · Issue #1 · stdlib-js/www-test-code-coverage