Skip to content

Include iframes in coverage report #12

@echenley

Description

@echenley

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__))
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions