Skip to content

Expand documentation on coverage report setup #72

@gomain

Description

@gomain

Please expand the coverage report section of the README to include minimal steps to set up coverage reporting. Such that people with lesser knowledge of babel and loaders can follow.

Included discussion was based on my personal experience. For context I use pnpm with workspaces via rush.

Discussed in #71 (comment)

So I'v finally got it working.

  1. Install "babel-register-esm", save dev
  2. In ./jest.config.mjs
    collectCoverage: true,
    coverageProvider: "babel",
    coverageReporters: ["text"],
  3. Add file ./babel.config.json
    {
      "plugins": ["babel-plugin-istanbul"]
    }
  4. Run tests with NODE_OPTIONS='--loader=babel-register-esm' jest
    babal-istanbul

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions