Skip to content

Allow tagging of files in coverage reports #15

Description

@donaldpipowitch

This is a follow up to this bsky discussion.

Feature Request

It would be nice if we could filter coverage reports by tags. My use case is tagging a file to a certain team. Other use cases that come to my mind is filtering coverage reports by domains or criticality/priority.

E.g. I could imagine to provide a { globPattern: string; tag: string; }[] in some config to accomplish this.

Activity

  1. AriPerkkio commented on Sep 11, 2026

    @AriPerkkio
    Member

    By filtering, do you mean filtering the results in the html reporter table? Or filtering in the text reporter that shows on CLI after test run?

  2. donaldpipowitch commented on Sep 11, 2026

    @donaldpipowitch
    Author

    In the html report 👍

  3. travzhang commented on Sep 15, 2026

    @travzhang
    Contributor

    Hi! I've already implemented file tagging for the HTML coverage report in #9.

    The config shape is close to what you suggested — a list of { glob, tag }:

    reporter: [
      [
        "html-modern",
        {
          fileTags: [
                  { glob: "packages/istanbul-lib-coverage/**", tag: "lib-coverage" },
                  { glob: "packages/istanbul-lib-instrument/**", tag: "lib-instrument" },
                  { glob: "packages/istanbul-lib-report/**", tag: "lib-report" },
                  { glob: "packages/istanbul-lib-source-maps/**", tag: "lib-source-maps" },
                  { glob: "packages/istanbul-report-html-modern/**", tag: "html-modern" },
          ],
        },
      ],
    ]

    To try it locally, check out that PR and run:

    npm i
    npm run build
    npm run test

    Then open coverage/index.html — you can filter files by tags in the report UI. Feedback welcome!

    Image
  4. donaldpipowitch commented on Sep 21, 2026

    @donaldpipowitch
    Author

    Finally had time to try it out. Looks really good. ❤️

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