-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Labels
coverageIssues and PRs related to native coverage support.Issues and PRs related to native coverage support.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.never-staleMark issue so that it is never considered staleMark issue so that it is never considered staletest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
I think the Node.js coverage reporter should include support for reporting statement coverage.
My idea is to parse the source code into an Abstract Syntax Tree (AST) using acorn-walk, and then use the Statement callback to extract statements. They could then be converted to CoverageStatements, (similarly to how the getLines function works with lines to CoverageLines).
These statements could then be mapped to ranges in the same way that lines are handled in mapRangeToLines.
I saw a (extremely complicated) way of doing this in https://github.com/cenfun/monocart-coverage-reports/, so it appears to be possible.
rozzilla and Delapouitepmarchini and rozzilla
Metadata
Metadata
Assignees
Labels
coverageIssues and PRs related to native coverage support.Issues and PRs related to native coverage support.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.never-staleMark issue so that it is never considered staleMark issue so that it is never considered staletest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Type
Projects
Status
Triaged