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 evanlucas committed Nov 13, 2017
1 parent 16c6222 commit 61fbd85
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-whatwg-url-setters.js
Original file line number Diff line number Diff line change
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 61fbd85

Please sign in to comment.