From 59827c25b44c7e9844fd2b6ae6c221b847b26244 Mon Sep 17 00:00:00 2001 From: Ueli Kunz Date: Fri, 5 Jan 2018 23:11:24 +0100 Subject: [PATCH 1/2] If the debug option is set to true, pass correct flag to the spawned node process, depending on the version of the currently running node process. --- Gruntfile.js | 1 + README.md | 3 ++- package.json | 5 +++-- tasks/protractor_runner.js | 7 ++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8b837fb..163006b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -51,6 +51,7 @@ module.exports = function(grunt) { testArgs1: { configFile:"test/testConf.js", options: { + debug: true, args: { params: { number: 1, diff --git a/README.md b/README.md index 265cd21..5daf41f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,8 @@ If false, protractor will give colored output, as it does by default. Type: `Boolean` Default value: `false` -If true, grunt will pass 'debug' as second argument to protractor CLI to enable node CLI debugging as described in [Protractor Debugging documentation](https://github.com/angular/protractor/blob/master/docs/debugging.md). +If true, grunt will pass debugger options to protractor CLI to enable node CLI debugging as described in [Protractor Debugging documentation](https://github.com/angular/protractor/blob/master/docs/debugging.md). +For node >= 8 '--inspect' is passed. Otherwise 'debug'. #### options.args Type: `Object` diff --git a/package.json b/package.json index 8847b4b..5dd8571 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,11 @@ "through2": "~2.0.0" }, "devDependencies": { - "grunt-contrib-jshint": "~0.11.3", + "grunt": "~0.4.1", "grunt-contrib-clean": "~0.7.0", + "grunt-contrib-jshint": "~0.11.3", "grunt-contrib-nodeunit": "~0.4.1", - "grunt": "~0.4.1" + "semver": "^5.4.1" }, "peerDependencies": { "grunt": ">=0.4.0" diff --git a/tasks/protractor_runner.js b/tasks/protractor_runner.js index c7ee1d1..00f125b 100644 --- a/tasks/protractor_runner.js +++ b/tasks/protractor_runner.js @@ -13,6 +13,7 @@ var path = require('path'); var fs = require('fs'); var split = require('split'); var through2 = require('through2'); +var semver = require('semver'); module.exports = function(grunt) { @@ -59,7 +60,11 @@ module.exports = function(grunt) { args.push('--no-jasmineNodeOpts.showColors'); } if (!grunt.util._.isUndefined(opts.debug) && opts.debug === true){ - args.splice(1,0,'debug'); + if(semver.gte(process.versions.node, '8.0.0')){ + args.unshift('--inspect'); + }else{ + args.splice(1,0,'debug'); + } } // Iterate over all supported arguments. From 50eda16cc6bebaba48f2c1a296fe61c698706b8a Mon Sep 17 00:00:00 2001 From: Ueli Kunz Date: Tue, 9 Jan 2018 20:55:46 +0100 Subject: [PATCH 2/2] remove debug: true flag, because it blocks automatic build process --- Gruntfile.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 163006b..8b837fb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -51,7 +51,6 @@ module.exports = function(grunt) { testArgs1: { configFile:"test/testConf.js", options: { - debug: true, args: { params: { number: 1,