Commit c3fd0ed5 authored by Arunoda Susiripala's avatar Arunoda Susiripala

Fix test cases.

parent 1da00949
...@@ -2,28 +2,24 @@ ...@@ -2,28 +2,24 @@
import { join, resolve } from 'path' import { join, resolve } from 'path'
import { existsSync } from 'fs' import { existsSync } from 'fs'
import { import {
nextServer,
renderViaHTTP, renderViaHTTP,
startApp, findPort,
stopApp, launchApp,
killApp,
waitFor waitFor
} from 'next-test-utils' } from 'next-test-utils'
const context = {} const context = {}
context.app = nextServer({
dir: join(__dirname, '../'),
dev: true,
quiet: true
})
jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000
describe('On Demand Entries', () => { describe('On Demand Entries', () => {
it('should pass', () => {})
beforeAll(async () => { beforeAll(async () => {
context.server = await startApp(context.app) context.appPort = await findPort()
context.appPort = context.server.address().port context.server = await launchApp(join(__dirname, '../'), context.appPort)
}) })
afterAll(() => stopApp(context.server)) afterAll(() => killApp(context.server))
it('should compile pages for SSR', async () => { it('should compile pages for SSR', async () => {
const pageContent = await renderViaHTTP(context.appPort, '/') const pageContent = await renderViaHTTP(context.appPort, '/')
...@@ -36,7 +32,7 @@ describe('On Demand Entries', () => { ...@@ -36,7 +32,7 @@ describe('On Demand Entries', () => {
}) })
it('should dispose inactive pages', async () => { it('should dispose inactive pages', async () => {
await renderViaHTTP(context.appPort, '/_next/-/pages/about') await renderViaHTTP(context.appPort, '/_next/-/page/about')
const aboutPagePath = resolve(__dirname, '../.next/bundles/pages/about.js') const aboutPagePath = resolve(__dirname, '../.next/bundles/pages/about.js')
expect(existsSync(aboutPagePath)).toBeTruthy() expect(existsSync(aboutPagePath)).toBeTruthy()
......
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