UNPKG

echidna-coverage-parser

Version:

Echidna log parser package

64 lines (50 loc) 1.43 kB
# Echidna Coverage Parser A TypeScript tool to parse and analyze Echidna code coverage reports for Solidity smart contracts. ## How to use # Echidna Coverage Parser A TypeScript tool to parse and analyze Echidna code coverage reports for Solidity smart contracts. ## Features - Parse Echidna coverage output files - Process coverage data into a structured format - Support for both ESM and CommonJS imports - TypeScript type definitions included ## Installation ```bash npm install echidna-coverage-parser ``` ## Usage ```javascript import { readCoverageFileAndProcess } from "echidna-coverage-parser"; import { readFileSync } from "fs"; const file = readFileSync("./coverage.txt", "utf-8"); const data:FileDataWithCoverage = readCoverageFileAndProcess(file, true); console.log(data); ``` Returns ```javascript export interface FileDataWithCoverage extends FileData { coverage: CoverageStats; } export interface FileData { path: string; data: LineData[]; } export interface CoverageStats { totalFunctions: number; coveredLines: number; revertedLines: number; untouchedLines: number; functionCoveragePercentage: number; lineCoveragePercentage: number; fullyCoveredFunctions: number; } export interface LineData { functionName: string; touched: boolean; reverted: boolean; isFullyCovered: boolean; untouchedLines: number; revertedContent: string[]; untouchedContent: string[]; } ```