Skip to content

Commit

Permalink
Add test for hydrating ssr error
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Sep 8, 2022
1 parent 20a6b5b commit aacb1df
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
@@ -0,0 +1,3 @@
export default function Page() {
throw new Error('Error during SSR')
}
13 changes: 13 additions & 0 deletions test/e2e/app-dir/index.test.ts
Expand Up @@ -1280,6 +1280,19 @@ describe('app dir', () => {
).toBe('Trigger Error!')
}
})

it('should hydrate empty shell to handle server-side rendering errors', async () => {
const browser = await webdriver(
next.url,
'/error/ssr-error-client-component'
)
const logs = await browser.log()
const errors = logs
.filter((x) => x.source === 'error')
.map((x) => x.message)
.join('\n')
expect(errors).toInclude('Error during SSR')
})
})
}

Expand Down

0 comments on commit aacb1df

Please sign in to comment.