Skip to content

IstanbulJS and nyc improvements #5431

@jon-kirwan

Description

@jon-kirwan

What

This repo uses IstanbulJS and nyc to generate JavaScript coverage reports.

However, there are a few areas for improvement:

  • Improved documentation. The original pull request added links to the IstanbulJS documentation (Implement JavaScript test coverage checking #4142), but it would be helpful to expand on this with more detailed, specific guidance. This could include explanations of how we use coverage, what the various options mean, and some practical examples.
  • Easier access to HTML reports. While both text and HTML report formats are available, accessing the HTML report is not very intuitive. Currently, you need to manually navigate to the generated file (for example: /govuk/frontend/coverage/javascript/frontend/index.html). Providing a simpler way to open or view this report would be useful.
  • Seeds can significantly affect coverage results, and differences between local and production can lead to inconsistent coverage outcomes. A clearer explanation of how seeds are generated and used would help avoid confusion and debugging issues.

Why

After recently encountering issues where branch coverage dropped below the thresholds, it became clear that there are gaps in our understanding. Addressing the points above would make it easier to diagnose and resolve problems in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions