# isparta

> A code coverage tool for ES6 (babel)

Latest version **4.1.1** (published 2018-12-19) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install isparta
pnpm add isparta
yarn add isparta
bun add isparta
```

Provides the command `isparta`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2018-12-19 |
| First published | 2014-11-17 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 24.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 642 |
| Author | Douglas Duteil |
| Maintainers | douglasduteil |
| Keywords | karma, karma-coverage, karma-traceur-preprocessor, istanbul, 6to5, babel, es6, harmony |

## Links

- npm: https://www.npmjs.com/package/isparta
- Repository: https://github.com/douglasduteil/isparta
- Homepage: http://github.com/douglasduteil/isparta
- Issues: http://github.com/douglasduteil/isparta/issues
- npm.io page: https://npm.io/package/isparta

## Dependencies (9)

- [which](https://npm.io/package/which.md) ^1.0.9
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.0
- [esprima](https://npm.io/package/esprima.md) ^4.0.0
- [istanbul](https://npm.io/package/istanbul.md) 0.4.5
- [escodegen](https://npm.io/package/escodegen.md) ^1.6.1
- [babel-core](https://npm.io/package/babel-core.md) ^6.1.4
- [source-map](https://npm.io/package/source-map.md) ^0.5.0
- [nomnomnomnom](https://npm.io/package/nomnomnomnom.md) ^2.0.0
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 4.1.1 (latest) — 2018-12-19
- 4.1.0 — 2018-07-05
- 4.0.0 — 2015-11-14
- 3.5.3 — 2015-11-05
- 3.5.2 — 2015-11-05
- 3.5.1 — 2015-11-02
- 3.5.0 — 2015-10-31
- 3.4.0 — 2015-10-31
- 3.3.0 — 2015-10-31
- 3.2.0 — 2015-10-31
- 3.1.0 — 2015-09-30
- 3.0.4 — 2015-08-29
- 3.0.3 — 2015-04-07
- 3.0.2 — 2015-04-07
- 3.0.1 — 2015-04-07
- … 20 more at https://npm.io/package/isparta/versions

## README

# isparta [![Build Status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![No Maintenance Intended][unmaintained-image]][unmaintained-url]

> Isparta is a code coverage tool for ES6 using [babel](https://github.com/babel/babel).

Its intention is to be used with [karma](http://karma-runner.github.io/) and [karma-coverage](https://github.com/karma-runner/karma-coverage), which provides code coverage reports using [istanbul](https://github.com/gotwarlost/istanbul).

[CHANGELOG](https://github.com/douglasduteil/isparta/releases)

## Installation

Isparta can be installed using

```sh
$ npm install --save-dev isparta
```

## Usage

**Not all the istanbul command/options are available with isparta**  
**Consult `isparta -h` for more information**

Here is an example to run a coverage over mocha tests  

```bash
babel-node node_modules/isparta/bin/isparta cover --report text --report html node_modules/mocha/bin/_mocha -- --reporter dot   
```

[douglasduteil/study-node-path-es6](https://github.com/douglasduteil/study-node-path-es6) demo the working cli

### With Karma

To use isparta, set the [instrumenter](https://github.com/karma-runner/karma-coverage/blob/master/README.md#instrumenter) for the JavaScript file type to `isparta`.

```js
coverageReporter: {
  // configure the reporter to use isparta for JavaScript coverage
  // Only on { "karma-coverage": "douglasduteil/karma-coverage#next" }
  instrumenters: { isparta : require('isparta') },
  instrumenter: {
    '**/*.js': 'isparta'
  }
}
```

But can customize the babel options thanks to my [fork](https://github.com/douglasduteil/karma-coverage/tree/next)

```js

// Note that you ".babelrc" will be the default options for babel.
var babelMoreOptions = { presets: 'es2015' };

// [...]

coverageReporter: {
  // configure the reporter to use isparta for JavaScript coverage
  // Only on { "karma-coverage": "douglasduteil/karma-coverage#next" }
  instrumenters: { isparta : require('isparta') },
  instrumenter: {
    '**/*.js': 'isparta'
  },
  instrumenterOptions: {
    isparta: { babel : babelMoreOptions }
  }
}
```

![](screenshot.png)

## License

    Copyright © 2014 Douglas Duteil <douglasduteil@gmail.com>
    This work is free. You can redistribute it and/or modify it under the
    terms of the Do What The Fuck You Want To Public License, Version 2,
    as published by Sam Hocevar. See the LICENCE file for more details.

[npm-url]: https://npmjs.org/package/isparta
[npm-image]: http://img.shields.io/npm/v/isparta.svg
[travis-url]: http://travis-ci.org/douglasduteil/isparta
[travis-image]: http://travis-ci.org/douglasduteil/isparta.svg?branch=master
[unmaintained-image]: http://unmaintained.tech/badge.svg
[unmaintained-url]: http://unmaintained.tech

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