fix: fix sitemaps routes test (#7441)

* fix: fix sitemaps routes test

* avoid checking all top-tokens paths
This commit is contained in:
Kristie Huang 2023-10-11 12:53:01 -04:00 committed by GitHub
parent 9f44e48cf1
commit b75438bc8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,12 +9,12 @@ describe('Routes', () => {
const contents = fs.readFileSync('./public/sitemap.xml', 'utf8') const contents = fs.readFileSync('./public/sitemap.xml', 'utf8')
const sitemap = await parseStringPromise(contents) 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')) .filter((p) => !p.includes('/0x'))
.forEach((path: string) => { .forEach((path: string) => {
expect(sitemapPaths).toContain(path) expect(pathNames).toContain(path)
}) })
}) })