From 7ef28d545b2c47530c24d4d42a0fe2b1bdbe59dd Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 22 Apr 2020 10:56:18 -0500 Subject: [PATCH] Update TypeScript API routes tests --- test/integration/typescript/test/index.test.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/integration/typescript/test/index.test.js b/test/integration/typescript/test/index.test.js index 12bfad3433094..45b8fba626567 100644 --- a/test/integration/typescript/test/index.test.js +++ b/test/integration/typescript/test/index.test.js @@ -55,6 +55,16 @@ describe('TypeScript Features', () => { expect(output).toContain('waiting for typecheck results...') }) + it('should respond to sync API route correctly', async () => { + const data = JSON.parse(await renderViaHTTP(appPort, '/api/sync')) + expect(data).toEqual({ code: 'ok' }) + }) + + it('should respond to async API route correctly', async () => { + const data = JSON.parse(await renderViaHTTP(appPort, '/api/async')) + expect(data).toEqual({ code: 'ok' }) + }) + it('should not fail to render when an inactive page has an error', async () => { await killApp(app) let evilFile = join(appDir, 'pages', 'evil.tsx') @@ -78,7 +88,7 @@ export default function EvilPage(): JSX.Element { }) }) - it('should compile the app', async () => { + it('should build the app', async () => { const output = await nextBuild(appDir, [], { stdout: true }) expect(output.stdout).toMatch(/Compiled successfully/) })