docs: fix class-coverage snippet for v8toIstanbul (#13371)

Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
Steve Zhang 2022-04-07 12:34:45 -04:00 committed by GitHub
parent 1dc2d02d35
commit de518338ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ const v8toIstanbul = require('v8-to-istanbul');
await page.goto('https://chromium.org');
const coverage = await page.coverage.stopJSCoverage();
for (const entry of coverage) {
const converter = new v8toIstanbul('', 0, { source: entry.source });
const converter = v8toIstanbul('', 0, { source: entry.source });
await converter.load();
converter.applyCoverage(entry.functions);
console.log(JSON.stringify(converter.toIstanbul()));

View File

@ -13257,7 +13257,7 @@ export interface ConsoleMessage {
* await page.goto('https://chromium.org');
* const coverage = await page.coverage.stopJSCoverage();
* for (const entry of coverage) {
* const converter = new v8toIstanbul('', 0, { source: entry.source });
* const converter = v8toIstanbul('', 0, { source: entry.source });
* await converter.load();
* converter.applyCoverage(entry.functions);
* console.log(JSON.stringify(converter.toIstanbul()));