typescript-coverage-report
typescript-coverage-report copied to clipboard
Bug: fs error in between builds
Describe the bug
In between runs of the CLI, there is a fs error from attempting to open coverage-ts/typescript-coverage.json - seems in clearing the dir for the new report, it also attempts to open it.
[Error: ENOENT: no such file or directory, open 'coverage-ts/typescript-coverage.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'coverage-ts/typescript-coverage.json'
}
To Reproduce Run the CLI from a clean install, below is my config:
"typeCoverage": {
"atLeast": 99,
"cache": true,
"debug": false,
"detail": true,
"ignoreCatch": false,
"ignoreFiles": [
"babel.config.js",
"ios/**/*",
"tmp/**/*",
"machines/**/*",
"apps/xstate/machines/**/*"
],
"project": "tsconfig.json",
"strict": true,
"suppressError": false,
"update": false,
"updateIfHigher": true,
"ignoreUnread": true,
"ignoreNested": true,
"ignoreAsAssertion": false,
"ignoreTypeAssertion": false,
"ignoreNonNullAssertion": false,
"ignoreObject": false,
"ignoreEmptyType": false,
"showRelativePath": true,
"noDetailWhenFailed": false,
"reportSemanticError": true,
"notOnlyInCWD": false,
"jsonOutput": false
}
Observe that coverage-ts/typescript-coverage.json is produced, re-run the CLI and it is deleted but the CLI exits with error code 255
Expected behaviour Exits with error code 0 Assets to be produced
Screenshots
CLI output from 3 consecutive runs with no other changes:
FS after a SUCCESSFUL run:
FS after a FAILED run Note: assets aren't generated nor the json coverage
Environment
- Tool version: typescript-coverage-report: 8.0.0
- OS: MacOS Sonoma 14.2.1
- Node version: 19.7.0
Noticed that the issue seems to have arisen from mistakenly including " coverage-ts/assets/source-file.js" in the report, after adding that to the ignoreFiles I can consistently run the reports, not sure why this would present the error that occurs though