Last active
December 15, 2015 14:39
-
-
Save wrumsby/5275804 to your computer and use it in GitHub Desktop.
Gruntfile that uses grunt-shell to run grover.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
'use strict'; | |
var files = ['src/**/*.js', 'test/**/*.js']; | |
grunt.initConfig({ | |
jshint: { | |
options: { | |
jshintrc: '.jshintrc' | |
}, | |
files: files | |
}, | |
shell: { | |
grover: { | |
command: 'grover --phantom-bin phantomjs ./test/test-runner.html -o ./grover.json --json', | |
options: { | |
callback: function (err, stdout, stderr, cb) { | |
var fs = require('fs'), | |
data; | |
data = JSON.parse(fs.readFileSync('./grover.json')); | |
console.log(stdout); | |
cb(!(data.failed || data.errors)); | |
} | |
} | |
} | |
}, | |
watch: { | |
scripts: { | |
files: files, | |
tasks: ['shell:grover', 'jshint'] | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-shell'); | |
// n.b. this task doesn't work on Windows | |
grunt.loadNpmTasks('grunt-notify'); | |
grunt.registerTask('default', ['watch']); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "whatever", | |
"version": "0.0.1", | |
"devDependencies": { | |
"grunt": "~0.4.1", | |
"grunt-contrib-jshint": "~0.1.1", | |
"grunt-contrib-watch": "~0.3.1", | |
"grunt-notify": "~0.1.4", | |
"grover": "~0.1.13", | |
"phantomjs": "~1.8.1-1", | |
"grunt-shell": "~0.2.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of setting up PhantomJS to be on my path I installed the NPM wrapper and created a symbolic link to the bin provided by the wrapper: