From c3fd0ed51a5ac3a1507ca73baa4afcd6d1ff10eb Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Mon, 24 Jul 2017 11:17:53 +0530 Subject: [PATCH] Fix test cases. --- test/integration/ondemand/test/index.test.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/integration/ondemand/test/index.test.js b/test/integration/ondemand/test/index.test.js index ce1a0074..8cc8618c 100644 --- a/test/integration/ondemand/test/index.test.js +++ b/test/integration/ondemand/test/index.test.js @@ -2,28 +2,24 @@ import { join, resolve } from 'path' import { existsSync } from 'fs' import { - nextServer, renderViaHTTP, - startApp, - stopApp, + findPort, + launchApp, + killApp, waitFor } from 'next-test-utils' const context = {} -context.app = nextServer({ - dir: join(__dirname, '../'), - dev: true, - quiet: true -}) jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 describe('On Demand Entries', () => { + it('should pass', () => {}) beforeAll(async () => { - context.server = await startApp(context.app) - context.appPort = context.server.address().port + context.appPort = await findPort() + context.server = await launchApp(join(__dirname, '../'), context.appPort) }) - afterAll(() => stopApp(context.server)) + afterAll(() => killApp(context.server)) it('should compile pages for SSR', async () => { const pageContent = await renderViaHTTP(context.appPort, '/') @@ -36,7 +32,7 @@ describe('On Demand Entries', () => { }) 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') expect(existsSync(aboutPagePath)).toBeTruthy()