From 73830d7737dc55c67e9bbc2de63ff7f4cd0e86a0 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sun, 14 Feb 2021 09:40:14 +0100 Subject: [PATCH] Log empty address sites explicitly --- packages/phishing/src/addrcheck.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/phishing/src/addrcheck.spec.ts b/packages/phishing/src/addrcheck.spec.ts index f76216854..3ef9da395 100644 --- a/packages/phishing/src/addrcheck.spec.ts +++ b/packages/phishing/src/addrcheck.spec.ts @@ -95,13 +95,15 @@ describe('addrcheck', (): void => { checkTag('https://dot4.org/promo/', 'p', 'class="payment-title"'), checkTag('https://polkadotairdrop.com/address/', 'cool') ]); - const mapFound = results.reduce((all, [site, found]) => ({ ...all, [site]: found }), {}); + const listEmpty = results.filter(([, found]) => !found.length).map(([site]) => site); + const mapFound = results.filter(([, found]) => found.length).reduce((all, [site, found]) => ({ ...all, [site]: found }), {}); const mapMiss = results .map(([site, found]): [string, string[]] => [site, found.filter((a) => !all.includes(a))]) .filter(([, found]) => found.length) .reduce((all, [site, found]) => ({ ...all, [site]: found }), {}); const sites = Object.keys(mapMiss); + console.log('Sites with no results\n', JSON.stringify(listEmpty, null, 2)); console.log('Addresses found\n', JSON.stringify(mapFound, null, 2)); console.log('Addresses missing\n', JSON.stringify(mapMiss, null, 2));