mocha-blanket: update

This commit is contained in:
Rico Sta. Cruz 2017-10-27 12:52:26 +08:00
parent edde2a5ee3
commit 1f98e6a964
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 20 additions and 9 deletions

View File

@ -1,13 +1,19 @@
---
title: Mocha blanket
category: JavaScript libraries
layout: 2017/sheet
intro: |
Use [blanket](https://npmjs.com/package/blanket) for easy coverage reporting for Mocha JavaScript tests.
---
Use [blanket] for easy coverage reporting.
### Quickstart guide
## Quickstart guide
Install blanket:
{: .-setup}
$ npm i --save-dev blanket
```bash
npm i --save-dev blanket
```
In your test helpers, use Blanket before `require`ing:
@ -20,8 +26,6 @@ if (process.env.COVERAGE) {
thing = require('../index');
```
## Add scripts to package.json
Add to `package.json`:
```json
@ -32,17 +36,24 @@ Add to `package.json`:
Be sure to ignore it:
$ echo "coverage.html" >> .gitignore
```bash
echo "coverage.html" >> .gitignore
```
Then run:
$ npm run coverage
```bash
npm run coverage
```
## Travis + coveralls.io support
### Travis + coveralls.io support
Visit [coveralls.io] then activate your repo. Then install the appropriate packages:
{: .-setup}
$ npm i --save-dev mocha-lcov-reporter coveralls
```bash
npm i --save-dev mocha-lcov-reporter coveralls
```
Add this to `.travis.yml`: