3 * https://github.com/johnbender/grunt-junit
5 * Copyright (c) 2012 John Bender
6 * Licensed under the MIT license.
9 var child_process = require( 'child_process' ),
10 semver = require( 'semver' );
12 module.exports = function( grunt ) {
13 grunt.registerTask( 'junit:env', function() {
14 var done = this.async();
16 if( !process.env.JUNIT_OUTPUT ){
17 grunt.fail.fatal( "The junit grunt plugin requires a directory be set " +
18 "for junit output in the env variable JUNIT_OUTPUT" );
21 child_process.exec( "phantomjs --version", function(err, stdout, stderr) {
22 if( semver.lt( stdout, '1.5.0' ) ){
23 grunt.fail.fatal( "The junit grunt plugin requires a version of phantomjs " +
24 "greater than or equal to 1.5.0" );
32 grunt.registerTask( 'junit', 'junit:env qunit' );