mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
There's apparently some interference with other tests when running the `withRouter` integration test in the CI, which leads to [frequent test failures](https://app.datadoghq.com/ci/test-runs?query=test_level%3Atest%20env%3Aci%20%40git.repository.id%3Agithub.com%2Fvercel%2Fnext.js%20%40test.service%3Anextjs%20%40test.suite%3A%2AwithRouter%2A%20%40test.status%3Afail&agg_m=count&agg_m_source=base&agg_t=count¤tTab=overview&eventStack=&fromUser=false&index=citest&start=1713009743249&end=1720785743249&paused=true). In lieu of identifying the interference source, we can refactor the test to an e2e test. This should also fix the flakiness. closes [NDX-64](https://linear.app/vercel/issue/NDX-64/investigate-flakiness-of-testintegrationwith-router) closes #67706
9 lines
212 B
JavaScript
9 lines
212 B
JavaScript
import { withRouter } from 'next/router'
|
|
|
|
function RouterMethodSSR({ router }) {
|
|
if (typeof window === 'undefined') router.push('/a')
|
|
return <p>Navigating...</p>
|
|
}
|
|
|
|
export default withRouter(RouterMethodSSR)
|