Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: using template string for concatenation #16918

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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