# test-coverage-comparison

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

Latest version **0.0.3** (published 2017-12-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install test-coverage-comparison
pnpm add test-coverage-comparison
yarn add test-coverage-comparison
bun add test-coverage-comparison
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-12-28 |
| First published | 2017-12-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alp Bilgin |
| Maintainers | alpbilgin |

## Links

- npm: https://www.npmjs.com/package/test-coverage-comparison
- Repository: https://github.com/AlpBilgin/test-coverage-comparison
- Homepage: https://github.com/AlpBilgin/test-coverage-comparison#readme
- Issues: https://github.com/AlpBilgin/test-coverage-comparison/issues
- npm.io page: https://npm.io/package/test-coverage-comparison

## Dependencies (1)

- [js2flowchart](https://npm.io/package/js2flowchart.md) ^1.0.4

## Recent versions

- 0.0.3 (latest) — 2017-12-28
- 0.0.2 — 2017-12-01
- 0.0.1 — 2017-12-01

## README

# 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](https://github.com/AlpBilgin/test-coverage-comparison) 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.

```JavaScript
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 (no else blocks), logical operators and assigment operators.

Creating local scope variables by copying initial values is allowed. Such that "holder = a;" will cause a holder variable to be internally created.

## TODO

### Analysis targets

- Else blocks
- Increment operator
- While blocks
- Declaration keyword (var, let, const) support
- Algebraic operations (+ - * /) support

### Algorithms

- Parser should be divided into smaller objects to allow finer grained output.

### Testing

- Testing can be made more robust.

---
_Source: https://npm.io/package/test-coverage-comparison · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
