fix: fix sitemaps routes test (#7441)
* fix: fix sitemaps routes test * avoid checking all top-tokens paths
This commit is contained in:
parent
9f44e48cf1
commit
b75438bc8b
@ -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)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user