2018-09-02 09:20:25 +00:00
|
|
|
import { loadFixture, getPort, Nuxt } from '../utils'
|
|
|
|
|
|
|
|
let nuxt = null
|
|
|
|
|
|
|
|
describe('basic https', () => {
|
|
|
|
beforeAll(async () => {
|
|
|
|
const options = await loadFixture('https')
|
|
|
|
nuxt = new Nuxt(options)
|
|
|
|
const port = await getPort()
|
2018-10-30 20:42:53 +00:00
|
|
|
await nuxt.server.listen(port, '0.0.0.0')
|
2018-09-02 09:20:25 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
test('/', async () => {
|
2018-10-30 20:42:53 +00:00
|
|
|
const { html } = await nuxt.server.renderRoute('/')
|
2018-11-08 09:41:24 +00:00
|
|
|
expect(html).toContain('<h1>Served over HTTPS!</h1>')
|
2018-09-02 09:20:25 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
// Close server and ask nuxt to stop listening to file changes
|
|
|
|
afterAll(async () => {
|
|
|
|
await nuxt.close()
|
|
|
|
})
|
|
|
|
})
|