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

Include iframes in coverage report #12

Open
echenley opened this issue Aug 10, 2022 · 0 comments
Open

Include iframes in coverage report #12

echenley opened this issue Aug 10, 2022 · 0 comments

Comments

@echenley
Copy link

This isn't an issue per-se, but in case anyone needs to include all iframes in their coverage numbers, you can modify the context script as follows:

for (const page of context.pages()) {
  await page.evaluate(() =>
    (window as any).collectIstanbulCoverage(JSON.stringify((window as any).__coverage__))
  );

  for (const frame of context.frames()) {
    await frame.evaluate(() => 
      (window as any).collectIstanbulCoverage(JSON.stringify((window as any).__coverage__))
    );
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant