Unverified Commit 6920c020 authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

Remove unpurpose test (#31898)

The test from #31784 can pass with or without the source code change in that PR.
I cannot repro it. The writable is true on build in the provided case 
parent c8457e3a
module.exports = {
reactStrictMode: true,
}
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
export default MyApp
import Document, { Head, Html, Main, NextScript } from 'next/document'
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
return { ...initialProps }
}
render() {
return (
<Html lang="en">
<Head>
{process.env.NODE_ENV === 'production' ? (
<>
<script id="hello" />
<script />
</>
) : null}
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}
export const getStaticPaths = () => {
return {
// `true` also works, but `false` does not, since it causes a 404
fallback: 'blocking',
paths: [],
}
}
export const getStaticProps = async () => {
return {
props: {},
}
}
export default function Foo() {
return <h1>hi</h1>
}
/* eslint-env jest */
import fs from 'fs-extra'
import { join } from 'path'
import {
renderViaHTTP,
nextBuild,
startApp,
stopApp,
nextServer,
} from 'next-test-utils'
jest.setTimeout(1000 * 60 * 2)
const appDir = join(__dirname, '..')
let app
let server
describe('Cannot assign to read only property children', () => {
beforeEach(() => fs.remove(join(appDir, '.next/')))
it('Should serve the page', async () => {
await nextBuild(appDir)
app = nextServer({
dir: join(__dirname, '../'),
dev: false,
quiet: true,
})
server = await startApp(app)
console.log(server.address().port)
const html = await renderViaHTTP(server.address().port, '/foo/123')
expect(html).toContain('hi')
})
afterAll(async () => {
if (server) stopApp(server)
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment