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
26 lines
522 B
JavaScript
26 lines
522 B
JavaScript
import App from 'next/app'
|
|
import React from 'react'
|
|
import HeaderNav from '../components/header-nav'
|
|
|
|
export default class MyApp extends App {
|
|
static async getInitialProps({ Component, router, ctx }) {
|
|
let pageProps = {}
|
|
|
|
if (Component.getInitialProps) {
|
|
pageProps = await Component.getInitialProps(ctx)
|
|
}
|
|
|
|
return { pageProps }
|
|
}
|
|
|
|
render() {
|
|
const { Component, pageProps } = this.props
|
|
return (
|
|
<>
|
|
<HeaderNav />
|
|
<Component {...pageProps} />
|
|
</>
|
|
)
|
|
}
|
|
}
|