rsnext/test/e2e/example.txt
JJ Kasper efabf81e23
Add util for generating new tests/error documents (#33001)
* Add util for generating new tests/error documents

* update compiled

* lint-fix

* apply suggestions

* update wording

* update compiled
2022-01-06 09:45:04 -06:00

26 lines
618 B
Text

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