echidna-coverage-parser
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

npm install echidna-coverage-parser

Usage

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

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[];
}

Package Sidebar

Install

npm i echidna-coverage-parser

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

34 kB

Total Files

14

Last publish

Collaborators

  • simon.busch01