vuejs / vue-jest

Jest Vue transformer
MIT License
748 stars 156 forks source link

Path of vue file for coverage seem to be wrong #499

Closed MedianAura closed 2 years ago

MedianAura commented 2 years ago

When I am trying to generate coverage for vue file. The path of the file seem to be wrong.

Failed to write coverage reports: ERROR: Error: Path contains invalid characters: E:\wamp\www\rxvigilanceV5\docproform\coverage\lcov-report\src\components\common\file:\E:\wamp\www\rxvigilanceV5\docproform\src\components\common STACK: Error: Path contains invalid characters: E:\wamp\www\rxvigilanceV5\docproform\coverage\lcov-report\src\components\common\file:\E:\wamp\www\rxvigilanceV5\docproform\src\components\common at checkPath (E:\wamp\www\rxvigilanceV5\docproform\node_modules\make-dir\index.js:16:18) at AsyncFunction.module.exports.sync (E:\wamp\www\rxvigilanceV5\docproform\node_modules\make-dir\index.js:108:2) at FileWriter.writeFile (E:\wamp\www\rxvigilanceV5\docproform\node_modules\istanbul-lib-report\lib\file-writer.js:184:16) at HtmlReport.onSummary (E:\wamp\www\rxvigilanceV5\docproform\node_modules\istanbul-reports\lib\html\index.js:364:44)

If I check the path in the JSON report :

"E:\wamp\www\rxvigilanceV5\docproform\src\components\common\file:\E:\wamp\www\rxvigilanceV5\docproform\src\components\common\date-picker.vue": {"path":"E:\wamp\www\rxvigilanceV5\docproform\src\components\common\file:\E:\wamp\www\rxvigilanceV5\docproform\src\components\common\date-picker.vue"

It seem the file name is prefixed with the protocol and the entire path so when writing lcov report the file path is wrong.

Package version :

"devDependencies": { "@types/jest": "^29.0.3", "@vue/vue2-jest": "29.1.0", "jest": "^29.0.3", "jest-junit": "^14.0.1", "jest-transform-stub": "^2.0.0", },