Fix flakey preload test (#30969)

This commit is contained in:
JJ Kasper 2021-11-04 14:50:24 -05:00 committed by GitHub
parent 0c494af97c
commit b408d73373
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -378,7 +378,8 @@ describe('Prefetching Links in viewport', () => {
})()`)
console.log({ linkHrefs, scriptSrcs })
expect(linkHrefs.some((href) => scriptSrcs.includes(href))).toBe(false)
expect(scriptSrcs.some((src) => src.includes('pages/index-'))).toBe(true)
expect(linkHrefs.some((href) => href.includes('pages/index-'))).toBe(false)
})
it('should not duplicate prefetches', async () => {