Skip to content

Commit

Permalink
Improve test assertions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eps1lon committed Apr 30, 2024
1 parent 560627d commit abbbabb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/integration/auto-export/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ describe('Auto Export', () => {
it('should include error link when hydration error does occur', async () => {
const browser = await webdriver(appPort, '/post-1/hydrate-error')
const logs = await browser.log()
expect(
logs.some((log) =>
log.message.includes(
'See more info here: https://nextjs.org/docs/messages/react-hydration-error'
)
)
).toBe(true)
expect(logs).toEqual(
expect.arrayContaining([
{
message: expect.stringContaining(
'See more info here: https://nextjs.org/docs/messages/react-hydration-error'
),
},
])
)
})
})
})

0 comments on commit abbbabb

Please sign in to comment.