2018-10-18 15:57:35 +00:00
|
|
|
import { getPort, loadFixture, Nuxt } from '../utils'
|
|
|
|
|
|
|
|
let port
|
|
|
|
let nuxt = null
|
|
|
|
|
|
|
|
describe('basic ssr', () => {
|
|
|
|
beforeAll(async () => {
|
|
|
|
const options = await loadFixture('async-config')
|
|
|
|
nuxt = new Nuxt(options)
|
|
|
|
port = await getPort()
|
2018-10-30 20:42:53 +00:00
|
|
|
await nuxt.server.listen(port, '0.0.0.0')
|
2018-10-18 15:57:35 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
test('/', async () => {
|
|
|
|
expect(nuxt.options.head.title).toBe('Async Config!')
|
2018-10-30 20:42:53 +00:00
|
|
|
const { html } = await nuxt.server.renderRoute('/')
|
2018-10-18 15:57:35 +00:00
|
|
|
expect(html.includes('<h1>I am ALIVE!</h1>')).toBe(true)
|
|
|
|
})
|
|
|
|
})
|