2018-08-10 15:23:09 +00:00
|
|
|
import { getPort, loadFixture, Nuxt } from '../utils'
|
|
|
|
|
|
|
|
let port
|
|
|
|
let nuxt = null
|
|
|
|
|
|
|
|
describe('custom-app-template', () => {
|
|
|
|
beforeAll(async () => {
|
2018-08-17 20:25:23 +00:00
|
|
|
const options = await loadFixture('custom-app-template')
|
2018-08-10 15:23:09 +00:00
|
|
|
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-08-10 15:23:09 +00:00
|
|
|
})
|
|
|
|
test('/', async () => {
|
2018-10-30 20:42:53 +00:00
|
|
|
const { html } = await nuxt.server.renderRoute('/')
|
2018-08-10 15:23:09 +00:00
|
|
|
expect(html.includes('<p>My Template</p>')).toBe(true)
|
|
|
|
expect(html.includes('<h1>Custom!</h1>')).toBe(true)
|
|
|
|
})
|
|
|
|
|
|
|
|
// Close server and ask nuxt to stop listening to file changes
|
|
|
|
afterAll(async () => {
|
|
|
|
await nuxt.close()
|
|
|
|
})
|
|
|
|
})
|