Skip to content

Commit

Permalink
fix test race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jul 6, 2023
1 parent c7cd1ae commit f914483
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/lib/next-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,11 @@ export async function getRedboxDescription(browser: BrowserInterface) {
p.shadowRoot.querySelector('[data-nextjs-dialog-header]')
)
const root = portal.shadowRoot
return root.querySelector('#nextjs__container_errors_desc').innerText
const text = root.querySelector(
'#nextjs__container_errors_desc'
).innerText
if (text === null) throw new Error('No redbox description found')
return text
}),
3000,
500,
Expand Down

0 comments on commit f914483

Please sign in to comment.