From 277c771e4e509f2eaa358b8c2b61e2f51b6a02ac Mon Sep 17 00:00:00 2001 From: Damian Mee Date: Sun, 15 Sep 2024 01:50:38 +0200 Subject: [PATCH] Make xo happy --- test/code.js | 6 +++--- test/name.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/code.js b/test/code.js index 9ed09a9..dacca05 100644 --- a/test/code.js +++ b/test/code.js @@ -95,11 +95,11 @@ test('fails on no match', t => { }); test('returns country code for every country name in JSON', async t => { - const countries = (await import('../countries.json', {with: {type: 'json'}})).default; + const {default: countries} = await import('../countries.json', {with: {type: 'json'}}); - Object.values(countries).flat().forEach(name => { + for (const name of Object.values(countries).flat()) { t.not(code(name), undefined, `Should return code for name ${name}`); - }); + } }); // diff --git a/test/name.js b/test/name.js index 8a78684..c914304 100644 --- a/test/name.js +++ b/test/name.js @@ -68,11 +68,11 @@ test('returns undefined if non-alphabetic characters are given', t => { }); test('returns country name for every country code in JSON', async t => { - const countries = (await import('../countries.json', {with: {type: 'json'}})).default; + const {default: countries} = await import('../countries.json', {with: {type: 'json'}}); - Object.keys(countries).forEach(code => { + for (const code of Object.keys(countries)) { t.not(name(code), undefined, `Should return correct name for code ${code}`); - }); + } }); //