Skip to content

Commit

Permalink
Add task for ci build (grunt travis)
Browse files Browse the repository at this point in the history
  - Calculate code coverage

  - Verify jshint is clean

  - Publish code coverage to coveralls
  • Loading branch information
jmaxxz committed Feb 26, 2015
1 parent 1f13d7f commit 343050e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ before_script:
- npm install -g grunt-cli
before_install:
- sudo apt-get install libpcap-dev
script:
- grunt travis
17 changes: 14 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,29 @@ module.exports = function(grunt) {
coverage: {
src: allJs,
options: {
reportFormats: ["text", "html"],
reportFormats: ["text", "html", "lcov"],
excludes: tests
}
}
}
},
coveralls: {
src: {
src: "coverage/lcov.info"
}
},
});

grunt.loadNpmTasks("grunt-coveralls");
grunt.loadNpmTasks("grunt-mocha-test");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-mocha-istanbul");

// Default task(s).
//The travis ci build
grunt.registerTask("travis", ["jshint", "mocha_istanbul:coverage", "coveralls:src"]);

//Check code coverage with grunt cover
grunt.registerTask("cover", ["mocha_istanbul:coverage"]);

//Just run grunt for day to day work
grunt.registerTask("default", ["jshint", "mochaTest:test"]);
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-jshint": "^0.11.0",
"grunt-coveralls": "^1.0.0",
"grunt-mocha-istanbul": "^2.3.1",
"grunt-mocha-test": "^0.12.7",
"istanbul": "^0.3.5",
Expand Down

0 comments on commit 343050e

Please sign in to comment.