diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/grunt/utils.js | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 0ba03da2..f0fffb14 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -33,11 +33,13 @@ module.exports = { var browsers = grunt.option('browsers'); var reporters = grunt.option('reporters'); var noColor = grunt.option('no-colors'); + var port = grunt.option('port'); var p = spawn('node', ['node_modules/karma/bin/karma', 'start', config, singleRun ? '--single-run=true' : '', reporters ? '--reporters=' + reporters : '', browsers ? '--browsers=' + browsers : '', - noColor ? '--no-colors' : '' + noColor ? '--no-colors' : '', + port ? '--port=' + port : '' ]); p.stdout.pipe(process.stdout); p.stderr.pipe(process.stderr); @@ -170,5 +172,24 @@ module.exports = { } next(); }; - } + }, + + parallelTask: function(name) { + var args = [name, '--port=' + this.lastParallelTaskPort]; + + if (grunt.option('browsers')) { + args.push('--browsers=' + grunt.option('browsers')); + } + + if (grunt.option('reporters')) { + args.push('--reporters=' + grunt.option('reporters')); + } + + this.lastParallelTaskPort++; + + + return {grunt: true, args: args}; + }, + + lastParallelTaskPort: 9876 }; |
