istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.55k stars 353 forks source link

nyc report is directed to coverage/webpack: folder which cant be resolved #1515

Open willyhalim opened 1 year ago

willyhalim commented 1 year ago

Node Version = 17.9.1 NYC Version: 15.1.0 Platform: Amazon Linux 2

i am trying to run coverage report of indendepent process using c8 ( assuming my test case will be written in java / using postman )

this is my .nycrc file


{
  "extends": "@istanbuljs/nyc-config-typescript",
  "check-coverage": true,
  "all": true,
  "parser-plugins": [
    "typescript",
    "decorators-legacy"
  ],
  "require": [
        "ts-node/register"
      ],
  "cache": false,
  "extension": [".ts",".js"],
   "exclude": [
       "node_modules/*.js",
       "node_modules/**",
       "**/node_modules/**",
       "node_modules/path-to-regexp/*.js",
       "node_modules/**/*.js",
       "tmp/**"
  ],
  "include" : ["apps/calculate/**","dist/apps/calculate/**"],
  "reporter": [
          "text",
          "text-summary",
          "lcov",
          "html"
        ],
  "report-dir": "coverage",
  "sourceMap": true,
  "instrument": true
}

My typescript application is located under apps/calculate/src/**

SourceMap looks like working as i can see coverage data as i pump more message through API but it cant find the original source code as it map to non existent folder ( dist/apps/calculate/webpack:/src )

dist/apps/calculate/webpack:/src | 59.03 | 11.36 | 46.66 | 59.03 |
logger.js | 43.85 | 9.52 | 30 | 43.85 | 18-46,65-68,79-82,86-87,91-94,98-99,103-106 main.ts | 92.3 | 50 | 80 | 92.3 | 43-44

Any idea on these ?