From b824cb8ee806cbe5937bc7182049c5d1757a2be6 Mon Sep 17 00:00:00 2001 From: Kristie Huang Date: Tue, 10 Oct 2023 16:49:48 -0400 Subject: [PATCH] fix: fix sitemaps routes test --- src/pages/routes.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/routes.test.ts b/src/pages/routes.test.ts index 9920a9fef1a..46a4966492f 100644 --- a/src/pages/routes.test.ts +++ b/src/pages/routes.test.ts @@ -9,12 +9,12 @@ describe('Routes', () => { const contents = fs.readFileSync('./public/sitemap.xml', 'utf8') const sitemap = await parseStringPromise(contents) - const sitemapPaths = sitemap.urlset.url.map((url: any) => new URL(url['$'].loc).pathname) + const sitemapPaths: string[] = sitemap.urlset.url.map((url: any) => new URL(url['$'].loc).pathname) - pathNames + sitemapPaths .filter((p) => !p.includes(':') && !p.includes('*') && !p.includes('not-found')) .forEach((path: string) => { - expect(sitemapPaths).toContain(path) + expect(pathNames).toContain(path) }) })