Skip to content
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

Allow for Instanbul coverage with Playwright #2779

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tidy-knives-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@web/test-runner-playwright': patch
---

Support browser generated coverage without native instrumentation
8 changes: 5 additions & 3 deletions packages/test-runner-playwright/src/PlaywrightLauncherPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ export class PlaywrightLauncherPage {
}

async stopSession(): Promise<SessionResult> {
const testCoverage = this.nativeInstrumentationEnabledOnPage
? await this.collectTestCoverage(this.config, this.testFiles)
: undefined;
const testCoverage = await this.collectTestCoverage(this.config, this.testFiles);

// navigate to an empty page to kill any running code on the page, stopping timers and
// breaking a potential endless reload loop
Expand Down Expand Up @@ -82,6 +80,10 @@ export class PlaywrightLauncherPage {
);
}

if (!this.nativeInstrumentationEnabledOnPage) {
return undefined;
}

// get native coverage from playwright
let coverage: V8Coverage[];
if (this.product === 'chromium') {
Expand Down