Crate swc_coverage_instrument

Source

Macros§

create_instrumentation_visitor
Expand given struct to contain necessary common filed for the coverage visitor with common utility functions.
instrumentation_branch_wrap_counter_helper
instrumentation_counter_helper
Interfaces to mark counters. Parent node visitor should pick up and insert marked counter accordingly. Unlike istanbul we can’t have single insert logic to be called in any arbitary child node.
instrumentation_stmt_counter_helper
Create a fn inserts stmt counter for each stmt
instrumentation_visitor
Generate common visitors to visit stmt.
visit_mut_for_like
A macro creates body for the for-variant visitors (for, for-of, for-in) which shares same logic. This also works for other loops like while, do-while.

Structs§

Branch
CoverageVisitor
FileCoverage
provides a read-only view of coverage for a single file. It has the following properties: path - the file path for which coverage is being tracked statementMap - map of statement locations keyed by statement index fnMap - map of function metadata keyed by function index branchMap - map of branch metadata keyed by branch index s - hit counts for statements f - hit count for functions b - hit count for branches
Function
InstrumentLogOptions
InstrumentOptions
Range
SourceMap

Enums§

BranchType
Node

Statics§

COVERAGE_MAGIC_KEY
COVERAGE_MAGIC_VALUE

Functions§

create_coverage_instrumentation_visitor
Public interface to create a visitor performs transform to inject coverage instrumentation counter.

Type Aliases§

BranchCoverageMap
BranchHitMap
BranchMap
FunctionMap
LineHitMap
Map to line number to hit count.
StatementMap