Skip to content

Commit

Permalink
Add unit test task with code coverage and dependencies, update test s…
Browse files Browse the repository at this point in the history
…cript
  • Loading branch information
robatron committed Jul 31, 2014
1 parent 0fd9a92 commit fd8dbad
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
coverage
17 changes: 15 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
var gulp = require('gulp');

var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');

gulp.task('bump', ['compile'], function(){
return gulp.src('./package.json')
.pipe(bump({type:'minor'}))
.pipe(gulp.dest('./'));
});
});

gulp.task('test', function (cb) {
gulp.src('lib/**/*.js')
.pipe(istanbul()) // Covering files
.on('finish', function () {
gulp.src(['test/*.js'])
.pipe(mocha())
.pipe(istanbul.writeReports()) // Creating the reports after tests runned
.on('end', cb);
});
});
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"email": "[email protected]"
},
"contributors": [
"Rob McGuire-Dale <[email protected]>",
"Andrew Gatlabayan <[email protected]>"
"Rob McGuire-Dale <[email protected]>",
"Andrew Gatlabayan <[email protected]>"
],
"repository": {
"type": "git",
Expand All @@ -29,7 +29,7 @@
"node": ">= 0.8.0"
},
"scripts": {
"test": "mocha --ui bdd --reporter spec"
"test": "gulp test"
},
"dependencies": {
"glob": "^4.0.2",
Expand All @@ -41,10 +41,12 @@
"devDependencies": {
"gulp": "^3.5.5",
"gulp-bump": "^0.1.8",
"gulp-istanbul": "^0.2.1",
"gulp-mocha": "^0.5.2",
"mocha": "^1.21.3",
"proxyquire": "^1.0.1",
"should": "^4.0.4",
"sinon": "^1.10.3",
"mocha": "^1.21.3"
"sinon": "^1.10.3"
},
"keywords": [
"gulp",
Expand Down

0 comments on commit fd8dbad

Please sign in to comment.