Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand documentation on coverage report setup #72

Open
gomain opened this issue Mar 8, 2023 Discussed in #71 · 0 comments
Open

Expand documentation on coverage report setup #72

gomain opened this issue Mar 8, 2023 Discussed in #71 · 0 comments

Comments

@gomain
Copy link

gomain commented Mar 8, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant