Skip to content

Commit

Permalink
test: Refactor ForEach and destructure the code
Browse files Browse the repository at this point in the history
  • Loading branch information
codie-bee committed Sep 25, 2023
1 parent 717e233 commit a48f610
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/parallel/test-url-domain-ascii-unicode.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ const domainWithASCII = [
['भारत.org', 'xn--h2brj9c.org'],
];

domainWithASCII.forEach((pair) => {
const domain = pair[0];
const ascii = pair[1];
for (const [domain, ascii] of domainWithASCII) {
const domainConvertedToASCII = domainToASCII(domain);
strictEqual(domainConvertedToASCII, ascii);
const asciiConvertedToUnicode = domainToUnicode(ascii);
strictEqual(asciiConvertedToUnicode, domain);
});
}

0 comments on commit a48f610

Please sign in to comment.