Skip to content

Commit abbbabb

Browse files
committed
Improve test assertions
This test will be fixed once we fix hydration diffs. The assertion is still an improvement since a test failure will actually tell you what you reived instead of just giving you a binary yes/no
1 parent 560627d commit abbbabb

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/integration/auto-export/test/index.test.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,15 @@ describe('Auto Export', () => {
9393
it('should include error link when hydration error does occur', async () => {
9494
const browser = await webdriver(appPort, '/post-1/hydrate-error')
9595
const logs = await browser.log()
96-
expect(
97-
logs.some((log) =>
98-
log.message.includes(
99-
'See more info here: https://nextjs.org/docs/messages/react-hydration-error'
100-
)
101-
)
102-
).toBe(true)
96+
expect(logs).toEqual(
97+
expect.arrayContaining([
98+
{
99+
message: expect.stringContaining(
100+
'See more info here: https://nextjs.org/docs/messages/react-hydration-error'
101+
),
102+
},
103+
])
104+
)
103105
})
104106
})
105107
})

0 commit comments

Comments
 (0)