test: use template string for concatenation

PR-URL: https://github.com/nodejs/node/pull/16918
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
Vipin Menon 2017-11-10 13:25:07 +05:30 committed by Franziska Hinkelmann
parent 97bfeff084
commit ef86f2c852

View File

@ -46,10 +46,10 @@ function runURLSettersTests(all_test_cases) {
var test_cases = all_test_cases[attribute_to_be_set];
for(var i = 0, l = test_cases.length; i < l; i++) {
var test_case = test_cases[i];
var name = "Setting <" + test_case.href + ">." + attribute_to_be_set +
" = '" + test_case.new_value + "'";
var name = `Setting <${test_case.href}>.${attribute_to_be_set}` +
` = '${test_case.new_value}'`;
if ("comment" in test_case) {
name += " " + test_case.comment;
name += ` ${test_case.comment}`;
}
test(function() {
var url = new URL(test_case.href);
@ -57,7 +57,7 @@ function runURLSettersTests(all_test_cases) {
for (var attribute in test_case.expected) {
assert_equals(url[attribute], test_case.expected[attribute])
}
}, "URL: " + name)
}, `URL: ${name}`);
// test(function() {
// var url = document.createElement("a");
// url.href = test_case.href;
@ -93,7 +93,7 @@ startURLSettersTests()
let name = `Setting <${testCase.href}>.${attributeToBeSet}` +
` = "${testCase.new_value}"`;
if ('comment' in testCase) {
name += ' ' + testCase.comment;
name += ` ${testCase.comment}`;
}
test(function() {
const url = new URL(testCase.href);
@ -101,7 +101,7 @@ startURLSettersTests()
for (const attribute in testCase.expected) {
assert_equals(url[attribute], testCase.expected[attribute]);
}
}, 'URL: ' + name);
}, `URL: ${name}`);
}
}
}