Files
4588a73542 Convert tests using createNext -> nextTestSetup (#93767)
## What?

Converts existing `createNext()` usage into `nextTestSetup()`. 

`createNext()` was the setup step we had before `nextTestSetup()` was
added.

This PR focused on the simple conversion cases. There will be a
follow-up to complete the last few.

---------

Co-authored-by: Cursor <[email protected]>
2026-05-12 13:16:31 +02:00

28 lines
616 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
import { renderViaHTTP } from 'next-test-utils'
describe('async export', () => {
const { next } = nextTestSetup({
files: {
'pages/index.js': `
export default function Page() {
return <p>hello world</p>
}
`,
'next.config.js': `
module.exports = async () => {
return {
basePath: '/docs'
}
}
`,
},
dependencies: {},
})
it('should work', async () => {
const html = await renderViaHTTP(next.url, '/docs')
expect(html).toContain('hello world')
})
})