Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added ability to check test coverage.
  • Loading branch information
gobwas committed Sep 6, 2015
1 parent 3b91a9a commit eb79778
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@ node_modules
npm-debug.log
.idea
*.iml
.yo-rc.json
.yo-rc.json
coverage
9 changes: 8 additions & 1 deletion .travis.yml
@@ -1,4 +1,11 @@
language: node_js

node_js:
- 'iojs'
- '0.12'
- '0.12'

script:
- npm run task ci

#after_success:
# - npm run task coveralls
33 changes: 33 additions & 0 deletions gulpfile.js
@@ -1,5 +1,38 @@
var gulp = require("gulp");

gulp.task('test', function (done) {
var istanbul = require("gulp-istanbul");
var mocha = require("gulp-mocha");

gulp.src(['./lib/**/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire())
.on('finish', function () {
gulp.src(['test/unit/**/*.js'])
.pipe(mocha())
.pipe(istanbul.writeReports())
// todo uncomment this while all tests are done
//.pipe(istanbul.enforceThresholds({ thresholds: { global: 90 } }))
.on('end', done);
});
});

gulp.task("coveralls", function() {
var coveralls = require('gulp-coveralls');

return gulp.src('./coverage/lcov.info')
.pipe(coveralls());
});

gulp.task("ci", function(done) {
var runSequence = require("run-sequence");

runSequence(
"test",
done
);
});

gulp.task("browser", function() {
var source = require("vinyl-source-stream");
var buffer = require("vinyl-buffer");
Expand Down
8 changes: 6 additions & 2 deletions package.json
Expand Up @@ -28,8 +28,10 @@
"node": ">=0.12"
},
"dependencies": {
"gulp-coveralls": "^0.1.4",
"hurl": "^0.2.0",
"inherits-js": "^0.1.1"
"inherits-js": "^0.1.1",
"run-sequence": "^1.1.2"
},
"devDependencies": {
"assert": "^1.3.0",
Expand All @@ -40,6 +42,8 @@
"chance": "^0.7.6",
"events": "^1.0.2",
"gulp": "^3.9.0",
"gulp-istanbul": "^0.10.0",
"gulp-mocha": "^2.1.3",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.3",
"gulp-uglify": "^1.2.0",
Expand All @@ -54,7 +58,7 @@
},
"scripts": {
"test": "mocha --recursive ./test/unit",
"build": "gulp"
"task": "gulp"
},
"main": "./index.js"
}

0 comments on commit eb79778

Please sign in to comment.