Skip to content

[heft] Upgrading to latest version of Heft from v50.7 test coverage includes files with /* istanbul ignore file */ #4460

Open
@nathanberry97

Description

@nathanberry97

Summary

  • We are trying to update our repo with the latest version of @rushstack/heft and @rushstack/heft-node-rig but are running into issues in our code coverage
  • When running code build it is including files which declare /* istanbul ignore file */ resulting in our code coverage dropping below our required coverage
  • But when using the following versions for Heft it excludes file which include /* istanbul ignore file */ :
Package Version which works
@rushstack/heft v50.7
@rushstack/heft-node-rig v1.13.1

The above table is the latest version of Heft we can currently use which works with /* istanbul ignore file */

Repro steps

Note If you want to use the latest packages for example repo please update the libraries/something/package.json with the following:

latest packages for Example repos package.json
{
"name": "something",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
  "build": "heft test --clean"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
  "@rushstack/eslint-config": "^3.5.1",
  "@rushstack/heft-jest-plugin": "^0.10.6",
  "@rushstack/heft-node-rig": "^2.3.14",
  "@rushstack/heft": "^0.63.4",
  "@types/heft-jest": "^1.0.6",
  "@types/node": "^18.18.0",
  "eslint": "^8.56.0",
  "typescript": "^5.3.3"
}
}

To reproduce the error please clone the example repo and run the following commands:

rush install
rush build
  • Now open the libraries/something/temp/coverage/index.html file in a browser
  • Note that the ignore.ts file is included in code coverage even though it has the /* istanbul ignore file */ code comment at the top of the file

If you then proceed to update the following packages to the versions shown below in libraries/something/package.json:

{
  "devDependencies": {
    "@rushstack/heft-node-rig": "^1.13.1",
    "@rushstack/heft": "^0.50.7"
  }
}

Once updated please run the following commands:

rush update
rush build
  • Now open the libraries/something/temp/coverage/index.html file in a browser
  • Note that the ignore.ts file is now not included in code coverage

Expected result:

We expect the latest versions of @rushstack/heft and @rushstack/heft-node-rig to exclude files with /* istanbul ignore file */ included in them.

Actual result:

The latest versions of @rushstack/heft and @rushstack/heft-node-rig are including any file with /* istanbul ignore file */ included in them in our code coverage.

Details

I'm not sure what is causing this error, so some suggestions would be great thank you :)

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@rushstack/heft version? v0.63.4
Operating system? Linux
Would you consider contributing a PR? No
Node.js version (node -v)? 18.18.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: easyProbably a quick fix. Want to contribute? :-)enhancementThe issue is asking for a new feature or design changeneeds more infoWe can't proceed because we need a better repro or an answer to a questionpriorityThe maintainers consider it to be an important issue. We should try to fix it soon.

    Type

    No type

    Projects

    Status

    General Discussions

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions