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

coverage() function does not work #1157

Open
piotrwalczak1 opened this issue Jul 4, 2023 · 0 comments
Open

coverage() function does not work #1157

piotrwalczak1 opened this issue Jul 4, 2023 · 0 comments

Comments

@piotrwalczak1
Copy link

Describe the bug
In spite of the fact that coverage file report is created using jest configuration, when running test for coverage from the docs it says:

Could not read coverage summary at readCoverageSummary
...
 at async BettererWorkerRunΩ.run

To Reproduce
betterer.ts

import { coverage } from "@betterer/coverage";

export default {
  "increase per-file test coverage": () => coverage(),
};

Expected behavior
Test should execute without errors

Screenshots*
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: [Ubuntu 22.04]
  • Betterer Version [e.g. 1.0.2, cli 5.4.0]
  • Node Version [e.g. 18.*]

Additional context
jest config:

module.exports = {
  preset: "ts-jest",
  testEnvironment: "node",
  testMatch: ["**/**/*test*.ts"],
  testPathIgnorePatterns: ["/node_modules/", "/coverage"],
  moduleFileExtensions: ["ts", "tsx", "js", "json"],
  verbose: true,
  transform: {
    "^.+\\.tsx?$": "ts-jest",
  },
  collectCoverage: true,
  collectCoverageFrom: ["**/lib/**/*.ts"],
  coveragePathIgnorePatterns: [
    "/node_modules/",
    "\\.d\\.ts$", // Ignore .d.ts files
  ],
};
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