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 building 100% coverage for my frontend.
And it seems like (empty-report)directive applies only to this.covSource[0] (or the one that matches by path), so if I map my source to multiple files - I cannot mark all of them as empty.
Details:
I run next.js build, run frontend tests on it and record coverage via Playwright's startJSCoverage. As I want to include all the files been built to get the 100% coverage, I read the whole build folder, tinker around with sourcemaps (kudos to playwright-coverage package) - and voila - I get all my files in the report.
The only problem I got is that report indicates all statements as run exactly once.
Eventually I tracked it down to generation of CovLine with count equals 1 to push it down to 0 later and magic (empty-report) function name.
The object I pass to applyCoverage looks like this:
Hello,
I'm building 100% coverage for my frontend.
And it seems like
(empty-report)
directive applies only tothis.covSource[0]
(or the one that matches by path), so if I map my source to multiple files - I cannot mark all of them as empty.Details:
I run next.js build, run frontend tests on it and record coverage via Playwright's
startJSCoverage
. As I want to include all the files been built to get the 100% coverage, I read the whole build folder, tinker around with sourcemaps (kudos toplaywright-coverage
package) - and voila - I get all my files in the report.The only problem I got is that report indicates all statements as run exactly once.
Eventually I tracked it down to generation of
CovLine
with count equals 1 to push it down to 0 later and magic(empty-report)
function name.The object I pass to
applyCoverage
looks like this:Unfortunately, this line picks only one
covSource
to apply empty report to.I applied a patch to that piece to accomplish empty report for all the
covSource
s:Is there a way around it or my patch looks good and we should include it in the repo?
The text was updated successfully, but these errors were encountered: