34 lines
786 B
TypeScript
34 lines
786 B
TypeScript
|
import { createNext } from 'e2e-utils'
|
||
|
import { NextInstance } from 'test/lib/next-modes/base'
|
||
|
import { renderViaHTTP } from 'next-test-utils'
|
||
|
|
||
|
describe('async export', () => {
|
||
|
let next: NextInstance
|
||
|
|
||
|
beforeAll(async () => {
|
||
|
next = await createNext({
|
||
|
files: {
|
||
|
'pages/index.js': `
|
||
|
export default function Page() {
|
||
|
return <p>hello world</p>
|
||
|
}
|
||
|
`,
|
||
|
'next.config.js': `
|
||
|
module.exports = async () => {
|
||
|
return {
|
||
|
basePath: '/docs'
|
||
|
}
|
||
|
}
|
||
|
`,
|
||
|
},
|
||
|
dependencies: {},
|
||
|
})
|
||
|
})
|
||
|
afterAll(() => next.destroy())
|
||
|
|
||
|
it('should work', async () => {
|
||
|
const html = await renderViaHTTP(next.url, '/docs')
|
||
|
expect(html).toContain('hello world')
|
||
|
})
|
||
|
})
|