1.0.1 • Published 5 months ago

echidna-coverage-parser v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

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

5 months ago

1.0.0

5 months ago