Skip to content

Commit

Permalink
test: use template string for concatenation
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
vipinmenon authored and fhinkel committed Nov 11, 2017
1 parent 97bfeff commit ef86f2c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-whatwg-url-setters.js
Expand Up @@ -46,18 +46,18 @@ 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);
url[attribute_to_be_set] = test_case.new_value;
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;
Expand Down Expand Up @@ -93,15 +93,15 @@ 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);
url[attributeToBeSet] = testCase.new_value;
for (const attribute in testCase.expected) {
assert_equals(url[attribute], testCase.expected[attribute]);
}
}, 'URL: ' + name);
}, `URL: ${name}`);
}
}
}
Expand Down

0 comments on commit ef86f2c

Please sign in to comment.