rsnext/test/e2e/config-promise-export/promise.test.ts
2024-04-09 00:25:43 +02:00

33 lines
789 B
TypeScript

import { createNext } from 'e2e-utils'
import { NextInstance } from 'e2e-utils'
import { renderViaHTTP } from 'next-test-utils'
describe('promise 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 = new Promise((resolve) => {
resolve({
basePath: '/docs'
})
})
`,
},
dependencies: {},
})
})
afterAll(() => next.destroy())
it('should work', async () => {
const html = await renderViaHTTP(next.url, '/docs')
expect(html).toContain('hello world')
})
})