Commit 56dc8548 authored by Arunoda Susiripala's avatar Arunoda Susiripala

Add ssr tests for next-export

parent 7b193f1a
...@@ -4,12 +4,13 @@ import { join } from 'path' ...@@ -4,12 +4,13 @@ import { join } from 'path'
import { import {
nextBuild, nextBuild,
nextExport, nextExport,
renderViaHTTP,
startStaticServer, startStaticServer,
stopApp stopApp
} from 'next-test-utils' } from 'next-test-utils'
import webdriver from 'next-webdriver' import webdriver from 'next-webdriver'
import ssr from './ssr'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000
const appDir = join(__dirname, '../') const appDir = join(__dirname, '../')
const context = {} const context = {}
...@@ -25,12 +26,7 @@ describe('Static Export', () => { ...@@ -25,12 +26,7 @@ describe('Static Export', () => {
}) })
afterAll(() => stopApp(context.server)) afterAll(() => stopApp(context.server))
describe('Render via SSR', () => { ssr(context)
it('should render the home page', async () => {
const html = await renderViaHTTP(context.port, '/')
expect(html).toMatch(/This is the home page/)
})
})
describe('Render via browser', () => { describe('Render via browser', () => {
it('should render the home page', async () => { it('should render the home page', async () => {
......
/* global describe, it, expect */
import { renderViaHTTP } from 'next-test-utils'
export default function (context) {
describe('Render via SSR', () => {
it('should render the home page', async () => {
const html = await renderViaHTTP(context.port, '/')
expect(html).toMatch(/This is the home page/)
})
it('should render a page with getInitialProps', async() => {
const html = await renderViaHTTP(context.port, '/dynamic')
expect(html).toMatch(/cool dynamic text/)
})
it('should render a dynamically rendered custom url page', async() => {
const html = await renderViaHTTP(context.port, '/dynamic/one')
expect(html).toMatch(/next export is nice/)
})
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment