Improve test assertions (#65319)

Closes NEXT-3310
This commit is contained in:
Sebastian Silbermann 2024-05-06 21:01:02 +02:00 committed by GitHub
parent e5b1d50101
commit aa1e9676f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2115,12 +2115,16 @@ describe('Prerender', () => {
const { version, files } = JSON.parse(contents)
expect(version).toBe(1)
console.log(
check.tests.map((item) => files.some((file) => item.test(file)))
try {
expect(check.tests).toEqual(
expect.toSatisfyAll((item) =>
files.some((file) => item.test(file))
)
expect(
check.tests.every((item) => files.some((file) => item.test(file)))
).toBe(true)
)
} catch (error) {
error.message += `\n\nFiles:\n${files.join('\n')}`
throw error
}
if (sep === '/') {
expect(