From feae7fd44aff889e9aad7fe3456d995d2ca10c73 Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Tue, 13 Feb 2024 03:05:52 +0100 Subject: [PATCH] Fix test case to handle email addresses --- src/app/utils/__tests__/externalLinks.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/utils/__tests__/externalLinks.test.ts b/src/app/utils/__tests__/externalLinks.test.ts index 3726687a9..ac39610c5 100644 --- a/src/app/utils/__tests__/externalLinks.test.ts +++ b/src/app/utils/__tests__/externalLinks.test.ts @@ -18,7 +18,7 @@ onlyRunOnCI('externalLinks', () => { // eslint-disable-next-line @typescript-eslint/no-unused-vars for (const [_linkName, url] of Object.entries(linksGroup)) { expect(typeof url).toBe('string') - expect(url).toMatch(/^https:/) + expect(url).toMatch(/^(https|mailto):/) } } }) @@ -32,6 +32,7 @@ onlyRunOnCI('externalLinks', () => { if (url.startsWith(externalLinksModule.github.commit)) continue // We store only partial url in constants if (url.startsWith(externalLinksModule.github.releaseTag)) continue // We store only partial url in constants if (url.startsWith(externalLinksModule.ipfs.proxyPrefix)) continue // We store only partial url in constants + if (url.startsWith('mailto')) continue // We can't test email addresses it.concurrent(`${linksGroupName} ${linkName} ${url}`, async () => { const response = await nodeFetch(url, { method: 'GET' })