Skip to content

Commit

Permalink
Add coveralls support
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Dec 10, 2015
1 parent 4244060 commit bf8f5a0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ bin/*.json
build
compile
.lock-wscript
node_modules
node_modules/
coverage/
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ script:
- gulp lint
- gulp dist
- gulp test karma
after_success:
- gulp coveralls
26 changes: 22 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,25 @@ var browserify = require('gulp-browserify');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var karma = require('karma');
var coveralls = require('gulp-coveralls');
var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');

var paths = {
index: './index.js',
tests: './test/**/*.js'
};

function preTest(src) {
return gulp.src(src)
.pipe(istanbul())
.pipe(istanbul.hookRequire());
}

function test(src){
gulp.src(src, { read: false } )
.pipe(exec('mocha <%= file.path %>')
.on('error', function(err){ console.log(err.message); }));
return gulp.src(src)
.pipe(mocha())
.pipe(istanbul.writeReports());
}

function testKarma(done){
Expand Down Expand Up @@ -50,14 +59,23 @@ gulp.task('dist', function(){
.pipe(gulp.dest('./dist'));
});

gulp.task('test', function() {
gulp.task('pre-test', function() {
preTest([paths.index]);
});

gulp.task('test', ['pre-test'], function() {
test([paths.tests]);
});

gulp.task('karma', function() {
testKarma();
});

gulp.task('coveralls', function() {
gulp.src('test/coverage/**/lcov.info')
.pipe(coveralls());
});

gulp.task('lint', function () {
return lint([paths.index]);
});
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
"browserify": "^12.0.1",
"gulp": "^3.9.0",
"gulp-browserify": "^0.5.1",
"gulp-coveralls": "^0.1.4",
"gulp-exec": "^2.1.2",
"gulp-istanbul": "^0.10.3",
"gulp-jshint": "^2.0.0",
"gulp-mocha": "^2.2.0",
"gulp-rename": "^1.2.0",
"gulp-uglify": "^1.5.1",
"jshint": "^2.8.0",
Expand Down
4 changes: 3 additions & 1 deletion readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ crypto module for hashing. Supports sha1, md5 and many others (depending on the
[![NPM](https://nodei.co/npm/object-hash.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/object-hash)
[![NPM](https://nodei.co/npm-dl/object-hash.png?months=6&height=3)](https://www.npmjs.com/package/object-hash)

[![status](https://secure.travis-ci.org/puleos/object-hash.png?branch=master)](https://secure.travis-ci.org/puleos/object-hash?branch=master)
[![Travis CI](https://secure.travis-ci.org/puleos/object-hash.png?branch=master)](https://secure.travis-ci.org/puleos/object-hash?branch=master)
[![Coverage Status](https://coveralls.io/repos/puleos/object-hash/badge.svg?branch=master&service=github)](https://coveralls.io/github/puleos/object-hash?branch=master)


* Hash values of any type.
* Provides a hash table implementation.
Expand Down

0 comments on commit bf8f5a0

Please sign in to comment.