# runas-plugin-test-runner-nyc

> Plugin for unit testing in npm libraries (and for recipes of runas)

Latest version **0.2.0** (published 2017-10-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install runas-plugin-test-runner-nyc
pnpm add runas-plugin-test-runner-nyc
yarn add runas-plugin-test-runner-nyc
bun add runas-plugin-test-runner-nyc
```

## 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.2.0 |
| Published | 2017-10-05 |
| First published | 2017-10-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=5.0.0 |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gluon CD |
| Maintainers | apecr |
| Keywords | runas-recipe, unit-testing, plugin, runas, istanbul, nyc |

## Links

- npm: https://www.npmjs.com/package/runas-plugin-test-runner-nyc
- Repository: https://gitlab.com/apecr/runas-plugin-test-runner-nyc
- Homepage: https://gitlab.com/apecr/runas-plugin-test-runner-nyc#README
- Issues: https://gitlab.com/runas/runas-plugin-test-runner-nyc
- npm.io page: https://npm.io/package/runas-plugin-test-runner-nyc

## Dependencies (6)

- [nyc](https://npm.io/package/nyc.md) ^11.2.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [runas-core](https://npm.io/package/runas-core.md) ^0.1.0
- [spawn-wrap](https://npm.io/package/spawn-wrap.md) ^1.3.8
- [foreground-child](https://npm.io/package/foreground-child.md) ^1.5.6
- [runas-callback-to-promise](https://npm.io/package/runas-callback-to-promise.md) ^0.1.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2017-10-05
- 0.2.0-beta.0 (beta) — 2017-10-04
- 0.1.0 — 2017-10-04
- 0.1.0-beta.1 — 2017-10-04
- 0.1.0-beta.0 — 2017-10-04

## README

# Plugin test-runner-nyc

Unit testing and coverage check whit NYC

## Instalation

For install, simply run 

```
npm install -g runas-plugin-test-runner-nyc
```

## Available functions

1. [runTestsAndCheckCoverage() addon](#runTestsAndCheckCoverage)


## <a name="runTestsAndCheckCoverage"></a>runTestsAndCheckCoverage addon

`this.runTestsAndCheckCoverage(params)` attemps to check the coverage of your
unit-testing suite

| Param | Type | Description |
| --- | --- | --- |
| params | Object | Object with the configuration for Nyc |

Example:

```javascript
run: function() {
  return this.runTestsAndCheckCoverage(params);
}
```

Example of params:

```json
{
  "_": [
    "npm",
    "test"
  ],
  "all": true,
  "reportDir": "test-reports",
  "reporter": [
    "text-summary",
    "lcov",
    "html"
  ],
  "exclude": [
    "node_modules",
    "*-test.js",
    "test-reports/**",
    "test/**"
  ],
  "checkCoverage": true,
  "statements": 70,
  "branches": 70,
  "functions": 70,
  "lines": 70
}
```

The more important parameters (all them are documented [here][1]):
1. "_" : array with the executable. If you want to execute "npm test"
you have to create the ["npm", "test"] value in this param.
1. "all": boolean. If true the instrumentation is in all the files
of the repo and not only in the ones that the executable passes.
1. "checkCoverage": boolean. Checks the percentages of coverage
according to the "statements", "branches", "functions" and "lines"
values.


[1]: https://github.com/istanbuljs/nyc#configuring-nyc

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