You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm have a React+ TypeScript + Vite + Vitest + Playwright-CT app and want to merge the coverage of the vitest unit tests with the coverage of the playwright-ct component tests. However, it seems like playwright-ct and vitest calculate the metrics differently due to an issue with the source map. I created a little repo to reproduce the issue:
Run unit tests: npm run test-unit and component tests npm run test-ct
Expected behavior
I expect the branchMap, statementMap and fnMap to be the same for playwright-ct and vitest
Actual behavior
Compare coverage/playwright-ct/coverage-final.json and coverage/vitest/coverage-final.json. You will see that for the App.tsx the branchMap is different:
In vitest the first branch is starting in line 9 and ending in line 11.
Thank you for confirming! Are there plans to include a fix in the next version? This is currently blocking for us as we cannot merge our unit and component test coverages.
Version
1.49.0
Steps to reproduce
Hello,
I'm have a React+ TypeScript + Vite + Vitest + Playwright-CT app and want to merge the coverage of the vitest unit tests with the coverage of the playwright-ct component tests. However, it seems like playwright-ct and vitest calculate the metrics differently due to an issue with the source map. I created a little repo to reproduce the issue:
npm install
npm run test-unit
and component testsnpm run test-ct
Expected behavior
I expect the
branchMap
,statementMap
andfnMap
to be the same for playwright-ct and vitestActual behavior
Compare
coverage/playwright-ct/coverage-final.json
andcoverage/vitest/coverage-final.json
. You will see that for theApp.tsx
thebranchMap
is different:In vitest the first branch is starting in line 9 and ending in line 11.
In playwright-ct, it's starting in line 9 and ending in line 10:
I asked in this issue about it cenfun/monocart-coverage-reports#94 and this comments suggests that the source map generation in playwright-ct is not correct cenfun/monocart-coverage-reports#94 (comment) .
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: