From 5369493fb3f82210f29a704520e2bf43d932abe1 Mon Sep 17 00:00:00 2001 From: mac-haojin Date: Sun, 16 Jul 2017 15:40:17 +0800 Subject: [PATCH 1/4] replace string concatenation in test/parallel/test-child-process-constructor.js with template literals --- test/parallel/test-child-process-constructor.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index ea81f806060cb6..335da6bbc5ffb5 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -19,8 +19,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options" argument must be of type object. Received type ' + - typeName(options) + message: `The "options" argument must be of type object. Received type \ +${typeName(options)}` })); }); } @@ -35,8 +35,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options.file" property must be of type string. Received ' + - 'type ' + typeName(file) + message: `The "options.file" property must be of type string. Received \ +type ${typeName(file)}` })); }); } @@ -51,8 +51,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options.envPairs" property must be of type array. ' + - 'Received type ' + typeName(envPairs) + message: `The "options.envPairs" property must be of type array. \ +Received type ${typeName(envPairs)}` })); }); } @@ -67,8 +67,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options.args" property must be of type array. Received ' + - 'type ' + typeName(args) + message: `The "options.args" property must be of type array. Received \ +type ${typeName(args)}` })); }); } From 7751588f6a43e647432e068d1db563468764d892 Mon Sep 17 00:00:00 2001 From: mac-haojin Date: Sun, 16 Jul 2017 16:07:42 +0800 Subject: [PATCH 2/4] follow reviewed suggestion to split at the sentence break --- test/parallel/test-child-process-constructor.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index 335da6bbc5ffb5..c1d5b5db44f5c0 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -19,8 +19,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "options" argument must be of type object. Received type \ -${typeName(options)}` + message: `The "options" argument must be of type object.\ + Received type ${typeName(options)}` })); }); } @@ -35,8 +35,8 @@ ${typeName(options)}` }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "options.file" property must be of type string. Received \ -type ${typeName(file)}` + message: `The "options.file" property must be of type string.\ + Received type ${typeName(file)}` })); }); } @@ -51,8 +51,8 @@ type ${typeName(file)}` }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "options.envPairs" property must be of type array. \ -Received type ${typeName(envPairs)}` + message: `The "options.envPairs" property must be of type array.\ + Received type ${typeName(envPairs)}` })); }); } @@ -67,8 +67,8 @@ Received type ${typeName(envPairs)}` }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "options.args" property must be of type array. Received \ -type ${typeName(args)}` + message: `The "options.args" property must be of type array.\ + Received type ${typeName(args)}` })); }); } From ada13995d820774751e9ed162fa44dd2fc2ca000 Mon Sep 17 00:00:00 2001 From: mac-haojin Date: Sun, 16 Jul 2017 17:30:52 +0800 Subject: [PATCH 3/4] Change keeping the one concatenation and indenting for readability --- test/parallel/test-child-process-constructor.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index c1d5b5db44f5c0..1fe94be91f14bb 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -19,8 +19,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "options" argument must be of type object.\ - Received type ${typeName(options)}` + message: 'The "options" argument must be of type object. ' + + `Received type ${typeName(options)}` })); }); } @@ -35,8 +35,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "options.file" property must be of type string.\ - Received type ${typeName(file)}` + message: 'The "options.file" property must be of type string. ' + + `Received type ${typeName(file)}` })); }); } @@ -51,8 +51,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "options.envPairs" property must be of type array.\ - Received type ${typeName(envPairs)}` + message: 'The "options.envPairs" property must be of type array. ' + + `Received type ${typeName(envPairs)}` })); }); } @@ -67,8 +67,8 @@ function typeName(value) { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "options.args" property must be of type array.\ - Received type ${typeName(args)}` + message: 'The "options.args" property must be of type array. ' + + `Received type ${typeName(args)}` })); }); } From e49daaa39ad343dbee5de4e9439b7e2f5272569a Mon Sep 17 00:00:00 2001 From: Haojin Date: Wed, 19 Jul 2017 13:33:14 +0800 Subject: [PATCH 4/4] Align the Received part with the The "options" part --- test/parallel/test-child-process-constructor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index 1fe94be91f14bb..fe94ff066ed815 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -20,7 +20,7 @@ function typeName(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options" argument must be of type object. ' + - `Received type ${typeName(options)}` + `Received type ${typeName(options)}` })); }); } @@ -36,7 +36,7 @@ function typeName(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.file" property must be of type string. ' + - `Received type ${typeName(file)}` + `Received type ${typeName(file)}` })); }); } @@ -52,7 +52,7 @@ function typeName(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.envPairs" property must be of type array. ' + - `Received type ${typeName(envPairs)}` + `Received type ${typeName(envPairs)}` })); }); } @@ -68,7 +68,7 @@ function typeName(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.args" property must be of type array. ' + - `Received type ${typeName(args)}` + `Received type ${typeName(args)}` })); }); }