New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

code-coverage-comparison

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-coverage-comparison

Tool for displaying code coverage according to different measures. Accepts a JS function and any combination of input variable values.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Test Coverage Comparison

Tool for displaying code coverage according to different measures. Accepts a JS function and any combination of input variable values.

Example

Download repo from Github and manually copy the only file and add the only dependency to you project. The the following minimal example should display a statement coverage in percentile.

var testCodeCoverage = require("./index.js");

var code = `
function code(a, b, c) {
    if(b<c){
      if(a<c){
      }
    }
    return;
}
`;

var testCases = [{a: 1,b: 1,c: 1}]

var tester = new testCodeCoverage.testCoverageComparison(code, testCases);

console.log(tester.statementCoverage());

Limitations

Currently only supports if blocks and logical operators.

TODO

Still WIP

Analysis targets

  • Assignment operator
  • Else blocks
  • Increment operator
  • While blocks

Algorithms

  • Test runner should use the shadow tree pointers.
  • Parser should be divided into smaller objects to allow finer grained output.

Testing

  • Needs testing

FAQs

Package last updated on 01 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts