Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TypeScript API routes tests #12112

Merged
merged 2 commits into from
Apr 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion test/integration/typescript/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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/)
})
Expand Down