Skip to content

Commit

Permalink
[test] setup for coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
stephantabor committed Oct 19, 2015
1 parent f10d267 commit afe8ec1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pkmn [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
# pkmn [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
> pokeapi.co wrapper. Details about the api can be found here: http://pokeapi.co/docs/

Expand Down Expand Up @@ -83,10 +83,11 @@ p.api()

MIT © [Stephan Tabor](http://stephantabor.com)


[npm-image]: https://badge.fury.io/js/pkmn.svg
[npm-url]: https://npmjs.org/package/pkmn
[travis-image]: https://travis-ci.org/stephantabor/pkmn.svg?branch=master
[travis-url]: https://travis-ci.org/stephantabor/pkmn
[daviddm-image]: https://david-dm.org/stephantabor/pkmn.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/stephantabor/pkmn
[coveralls-image]: https://coveralls.io/repos/stephantabor/pkmn/badge.svg
[coveralls-url]: https://coveralls.io/r/stephantabor/pkmn
17 changes: 14 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
var path = require('path');
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var excludeGitignore = require('gulp-exclude-gitignore');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var nsp = require('gulp-nsp');
var plumber = require('gulp-plumber');
var coveralls = require('gulp-coveralls');
var babel = require('gulp-babel');
var isparta = require('isparta');

Expand Down Expand Up @@ -36,9 +38,9 @@ gulp.task('pre-test', function () {
gulp.task('test', ['pre-test'], function (cb) {
var mochaErr;

gulp.src(['test/unit.js', 'test/integration.js'])
gulp.src('test/**/*.js')
.pipe(plumber())
.pipe(mocha({reporter: 'nyan'}))
.pipe(mocha({reporter: 'spec'}))
.on('error', function (err) {
mochaErr = err;
})
Expand All @@ -48,11 +50,20 @@ gulp.task('test', ['pre-test'], function (cb) {
});
});

gulp.task('coveralls', ['test'], function () {
if (!process.env.CI) {
return;
}

return gulp.src(path.join(__dirname, 'coverage/lcov.info'))
.pipe(coveralls());
});

gulp.task('babel', function () {
return gulp.src('lib/**/*.js')
.pipe(babel())
.pipe(gulp.dest('dist'));
});

gulp.task('prepublish', ['nsp', 'babel']);
gulp.task('default', ['static', 'test']);
gulp.task('default', ['static', 'test', 'coveralls']);
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pkmn",
"version": "1.0.5",
"version": "1.0.6",
"description": "a node.js pokeapi.co api wrapper",
"homepage": "",
"repository": "stephantabor/pkmn",
Expand All @@ -25,15 +25,14 @@
"chai-as-promised": "^5.1.0",
"gulp": "^3.6.0",
"gulp-babel": "^5.1.0",
"gulp-coveralls": "^0.1.4",
"gulp-eslint": "^1.0.0",
"gulp-exclude-gitignore": "^1.0.0",
"gulp-istanbul": "^0.9.0",
"gulp-mocha": "^2.0.0",
"gulp-nsp": "^0.4.5",
"gulp-plumber": "^1.0.0",
"isparta": "^3.0.3",
"rewire": "^2.3.4",
"sinon": "^1.17.1"
"isparta": "^3.0.3"
},
"scripts": {
"prepublish": "gulp prepublish",
Expand Down

0 comments on commit afe8ec1

Please sign in to comment.