-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Merging with nyc storybook test coverage with other reports generated by coverageProvider 'istanbul' result in wrong coverage #1559
Comments
There are 3 different versions of [email protected] /demo-test-coverage
├─┬ @storybook/[email protected]
│ ├─┬ @jsdevtools/[email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ @storybook/[email protected]
│ └─┬ @storybook/[email protected]
│ └─┬ @jest/[email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ @vitest/[email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └─┬ @jest/[email protected]
│ └─┬ @jest/[email protected]
│ └── [email protected] deduped
└─┬ [email protected]
└── [email protected] |
@cenfun thank you, after syncing all
"overrides": {
"@storybook/addon-coverage": {
"istanbul-lib-instrument": "^6.0.2"
},
"@jsdevtools/coverage-istanbul-loader": {
"istanbul-lib-instrument": "^6.0.2"
},
"vite-plugin-istanbul": {
"istanbul-lib-instrument": "^6.0.2"
},
"@jest/reporters": {
"istanbul-lib-instrument": "^6.0.2"
},
"@vitest/coverage-istanbul": {
"istanbul-lib-instrument": "^6.0.2"
},
"nyc": {
"istanbul-lib-instrument": "^6.0.2"
},
"babel-plugin-istanbul": {
"istanbul-lib-instrument": "^6.0.2"
}
}, Even after adding specs and storybook the coverage is 95.45% (expected: 100%). The original idea was to have smoke test coverage report |
@cenfun I am working on this together with @meanstackmax. I am unsure but it seems it is not working even after harmonizing the dependency resolution. Maybe you have any other idea why we are unable to merge/generate the report properly? |
@snake-py Yes, the Istanbul ecosystem depends not only on In fact, I don't have any other idea about
|
Link to bug demonstration repository https://github.com/meanstackmax/demo-test-coverage/tree/main
Expected Behavior
Vitest and storybook should use the same source map outputted, thus the issue with different columns for the same stmt not affecting merged report
Observed Behavior
I am trying to generate a merged code report. Therefore, I am using for my unit tests vitest with istanbul. For Storybook I am using the addon which also uses istanbul. To merge the reports I am using nyc.
The issue I am having is that the reports of vitest and storybook are showing me different columns for the same stmt. This leads to not correct merging.
For example in one component vitest said that there is a stmt on line 38 start at col 18 and ends on the same line.
However, storybook coverage report says the statement is on line 38 in column 2:
Troubleshooting steps
-Tried to add this to package.json, but it didn't work:
Environment Information
The text was updated successfully, but these errors were encountered: