Skip to content

Commit

Permalink
test: replace var with const/let in test/parallel/test-whatwg-url-set…
Browse files Browse the repository at this point in the history
…ters.js

Refs: nodejs/code-and-learn#97
  • Loading branch information
peze committed Nov 4, 2019
1 parent 3a076ba commit c658209
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/parallel/test-whatwg-url-setters.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ function startURLSettersTests() {
}

function runURLSettersTests(all_test_cases) {
for (var attribute_to_be_set in all_test_cases) {
for (const attribute_to_be_set in all_test_cases) {
if (attribute_to_be_set == "comment") {
continue;
}
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}` +
const test_cases = all_test_cases[attribute_to_be_set];
for(let i = 0, l = test_cases.length; i < l; i++) {
const test_case = test_cases[i];
let name = `Setting <${test_case.href}>.${attribute_to_be_set}` +
` = '${test_case.new_value}'`;
if ("comment" in test_case) {
name += ` ${test_case.comment}`;
}
test(function() {
var url = new URL(test_case.href);
const url = new URL(test_case.href);
url[attribute_to_be_set] = test_case.new_value;
for (var attribute in test_case.expected) {
for (const attribute in test_case.expected) {
assert_equals(url[attribute], test_case.expected[attribute])
}
}, `URL: ${name}`);
Expand Down

0 comments on commit c658209

Please sign in to comment.