Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
2b9425c2
Unverified
Commit
2b9425c2
authored
Apr 22, 2020
by
JJ Kasper
Committed by
GitHub
Apr 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update TypeScript API routes tests (#12112)
parent
eb367db9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
index.test.js
test/integration/typescript/test/index.test.js
+11
-1
No files found.
test/integration/typescript/test/index.test.js
View file @
2b9425c2
...
@@ -55,6 +55,16 @@ describe('TypeScript Features', () => {
...
@@ -55,6 +55,16 @@ describe('TypeScript Features', () => {
expect
(
output
).
toContain
(
'waiting for typecheck results...'
)
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
()
=>
{
it
(
'should not fail to render when an inactive page has an error'
,
async
()
=>
{
await
killApp
(
app
)
await
killApp
(
app
)
let
evilFile
=
join
(
appDir
,
'pages'
,
'evil.tsx'
)
let
evilFile
=
join
(
appDir
,
'pages'
,
'evil.tsx'
)
...
@@ -78,7 +88,7 @@ export default function EvilPage(): JSX.Element {
...
@@ -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
})
const
output
=
await
nextBuild
(
appDir
,
[],
{
stdout
:
true
})
expect
(
output
.
stdout
).
toMatch
(
/Compiled successfully/
)
expect
(
output
.
stdout
).
toMatch
(
/Compiled successfully/
)
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment