Skip to content

Commit

Permalink
Add test coverage via Istanbul and Coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
koistya committed Mar 31, 2016
1 parent 9759ade commit 7b66c99
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files

coverage
docs/dist
lib
node_modules
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.travis.xml
coverage
docs
test
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ language: node_js
node_js:
- '5'
- '4'
before_script:
- npm run lint
script:
- npm run test:cover
after_success:
- npm run coveralls
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![NPM version](http://img.shields.io/npm/v/generator-javascript.svg?style=flat-square)](https://www.npmjs.com/package/generator-javascript)
[![NPM downloads](http://img.shields.io/npm/dm/generator-javascript.svg?style=flat-square)](https://www.npmjs.com/package/generator-javascript)
[![Build Status](http://img.shields.io/travis/kriasoft/babel-starter-kit/master.svg?style=flat-square)](https://travis-ci.org/kriasoft/babel-starter-kit)
[![Coverage Status](https://img.shields.io/coveralls/kriasoft/babel-starter-kit.svg?style=flat-square)](https://coveralls.io/github/kriasoft/babel-starter-kit)
[![Dependency Status](http://img.shields.io/david/dev/kriasoft/babel-starter-kit.svg?style=flat-square)](https://david-dm.org/kriasoft/babel-starter-kit#info=devDependencies)
[![Online Chat](http://img.shields.io/badge/chat_room-%23babel--starter--kit-blue.svg?style=flat-square)](https://gitter.im/kriasoft/babel-starter-kit)

Expand All @@ -11,9 +12,9 @@
### Features

&nbsp; &nbsp; ✓ Next generation JavaScript via [Babel](http://babeljs.io/)<br>
&nbsp; &nbsp;Publish to [NPM](https://www.npmjs.com/) as ES5, ES6+ and UMD<br>
&nbsp; &nbsp; ✓ Pre-configured tests with [Mocha](http://mochajs.org/), [Chai](http://chaijs.com/) and [Sinon](http://sinonjs.org/)<br>
&nbsp; &nbsp; ✓ Project documentation boilerplate ([demo](http://www.kriasoft.com/babel-starter-kit/))<br>
&nbsp; &nbsp;Pre-configured unit tests with [Mocha](http://mochajs.org/), [Chai](http://chaijs.com/), and [Sinon](http://sinonjs.org/)<br>
&nbsp; &nbsp; ✓ Pre-configured test coverage wtih [Istanbul](https://github.com/gotwarlost/istanbul), and [Coveralls](https://coveralls.io/)<br>
&nbsp; &nbsp; ✓ Project homepage boilerplate generated from `docs/*.md` files with [Easystatic](https://easystatic.com) ([demo](http://www.kriasoft.com/babel-starter-kit/))<br>
&nbsp; &nbsp;[Yeoman](http://yeoman.io/) generator ([generator-javascript](https://github.com/kriasoft/babel-starter-kit/tree/yeoman-generator))<br>
&nbsp; &nbsp; ✓ Cross-platform, minimum dependencies<br>

Expand All @@ -37,8 +38,10 @@ Run `npm start` to launch a development server with the documentation site.
### How to Test

```shell
$ npm run lint # Lint your code
$ npm test # Run unit tests, or `npm test -- --watch`
$ npm run lint # Lint the source code with ESLint
$ npm test # Run unit tests with Mocha
$ npm test -- --watch # Run unit tests wtih Mocha, and watch files for changes
$ npm run cover # Run test coverage with Istanbul
```

### How to Update
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.7.2",
"chai": "^3.5.0",
"coveralls": "^2.11.9",
"eslint": "^2.5.3",
"eslint-config-airbnb": "6.2.0",
"eslint-plugin-react": "^4.2.3",
"istanbul": "^1.0.0-alpha.2",
"mocha": "^2.4.5",
"rimraf": "^2.5.2",
"sinon": "^2.0.0-pre"
},
"scripts": {
"lint": "eslint src test",
"test": "mocha test --compilers js:babel-register",
"test": "mocha --compilers js:babel-register",
"test:cover": "babel-node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- -R spec",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"build": "rimraf lib && babel src --out-dir lib",
"publish": "rimraf lib && babel src --out-dir lib",
"publish:docs": "easystatic deploy --repo kriasoft/babel-starter-kit",
Expand Down

0 comments on commit 7b66c99

Please sign in to comment.