Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactor istanbul-lib-report so report can choose summarizer (#408
- Loading branch information
1 parent
3354bfb
commit 0f328fd
Showing
24 changed files
with
821 additions
and
752 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
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
// TODO: switch to class private field when targetting node.js 12 | ||
const _summarizer = Symbol('ReportBase.#summarizer'); | ||
|
||
class ReportBase { | ||
constructor(summarizer) { | ||
this[_summarizer] = summarizer; | ||
} | ||
|
||
execute(context) { | ||
context.getTree(this[_summarizer]).visit(this, context); | ||
} | ||
} | ||
|
||
module.exports = ReportBase; |
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
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
Oops, something went wrong.