-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented puppeteer to V8 class (#4)
- Loading branch information
Showing
2 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
class PuppeteerToV8 { | ||
// constructor () {} | ||
} | ||
constructor (coverageInfo) { | ||
this.coverageInfo = coverageInfo | ||
} | ||
|
||
setCoverageInfo (coverageInfo) { | ||
this.coverageInfo = coverageInfo | ||
} | ||
|
||
module.exports = () => { | ||
return new PuppeteerToV8() | ||
convertCoverage () { | ||
// Iterate through coverage info and create IDs | ||
let id = 0 | ||
|
||
return this.coverageInfo.map(coverageItem => { | ||
return { | ||
scriptId: id++, | ||
url: coverageItem.url, | ||
functions: { ranges: coverageItem.ranges } | ||
} | ||
}) | ||
} | ||
} | ||
|
||
module.exports = () => new PuppeteerToV8() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters