Skip to content

Commit

Permalink
Swap out vendorized Jasmine runner for grunt-contrib-jasmine
Browse files Browse the repository at this point in the history
We recently had some problems getting the spec suite to run in Travis
CI, even on old commits where it once ran correctly. This seems to be
happening because either a newer version of Node, npm, phantomjs, or
Travis CI included a change that broke our setup.

To fix this, and in hopes of making it more resilient for the future, I
am swapping out my vendorized Jasmine runner for grunt-contrib-jasmine.
At the same time, I added some JSHint to help keep things in check.

This more or less followed the guide as written up at:

  http://travisjeffery.com/b/2013/09/testing-javascript-projects-with-grunt-jasmine-jshint/

Change-Id: If45b72461ddecd12acb20a674e2ac78016dc911b
Reviewed-on: http://gerrit.causes.com/36753
Reviewed-by: Hao Su <[email protected]>
Tested-by: Joe Lencioni <[email protected]>
  • Loading branch information
lencioni committed Mar 31, 2014
1 parent 08cafd2 commit b8721ec
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 3,433 deletions.
16 changes: 16 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"validthis" : true,
"multistr" : true,
"laxcomma" : true,
"laxbreak" : true,
"browser" : true,
"eqeqeq" : false,
"eqnull" : true,
"debug" : true,
"devel" : true,
"curly" : false,
"boss" : true,
"expr" : true,
"asi" : true,
"supernew" : true
}
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
node_js:
- "0.10"
before_script:
- npm install -g grunt-cli
notifications:
email: false
30 changes: 30 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* jshint node: true */

module.exports = function(grunt) {
"use strict";

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
"*.js",
"spec/*.js"
],
options: {
jshintrc: '.jshintrc'
}
},
jasmine: {
src: "method-proxy.js",
options: {
specs: "spec/**/*.js"
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');

grunt.registerTask('test', ['jshint', 'jasmine']);
grunt.registerTask('default', ['test']);
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"bugs": "https://github.com/causes/method-proxy-js/issues",
"description": "Forwards method calls to an object.",
"devDependencies": {
"phantomjs": "1.9.x"
"grunt": "~0.4.0",
"grunt-contrib-jshint": "~0.9.0",
"grunt-contrib-jasmine": "~0.5.0"
},
"license": "MIT",
"main": "method-proxy.js",
Expand All @@ -17,7 +19,7 @@
"url": "https://github.com/causes/method-proxy-js.git"
},
"scripts": {
"test": "phantomjs node_modules/phantomjs/lib/phantom/examples/run-jasmine.js test/SpecRunner.html"
"test": "grunt test"
},
"version": "1.0.2"
}
File renamed without changes.
48 changes: 0 additions & 48 deletions test/SpecRunner.html

This file was deleted.

20 changes: 0 additions & 20 deletions test/vendor/jasmine/MIT.LICENSE

This file was deleted.

Loading

0 comments on commit b8721ec

Please sign in to comment.