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
f7bdf29e
Unverified
Commit
f7bdf29e
authored
May 19, 2020
by
Joe Haddad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Lint
parent
0d059045
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
[...slug].js
test/integration/api-catch-all/pages/api/users/[...slug].js
+1
-1
index.test.js
test/integration/api-catch-all/test/index.test.js
+3
-3
No files found.
test/integration/api-catch-all/pages/api/users/[...slug].js
View file @
f7bdf29e
export
default
function
(
req
,
res
)
{
export
default
function
(
req
,
res
)
{
res
.
json
(
req
.
query
)
}
test/integration/api-catch-all/test/index.test.js
View file @
f7bdf29e
...
...
@@ -20,7 +20,7 @@ let app
function
runTests
()
{
it
(
'should return data when catch-all'
,
async
()
=>
{
const
data
=
await
fetchViaHTTP
(
appPort
,
'/api/users/1'
,
null
,
{}).
then
(
res
=>
res
.
ok
&&
res
.
json
()
(
res
)
=>
res
.
ok
&&
res
.
json
()
)
expect
(
data
).
toEqual
({
slug
:
[
'1'
]
})
...
...
@@ -28,7 +28,7 @@ function runTests() {
it
(
'should 404 when catch-all with index and trailing slash'
,
async
()
=>
{
const
data
=
await
fetchViaHTTP
(
appPort
,
'/api/users/'
,
null
,
{}).
then
(
res
=>
res
.
status
(
res
)
=>
res
.
status
)
expect
(
data
).
toEqual
(
404
)
...
...
@@ -36,7 +36,7 @@ function runTests() {
it
(
'should return data when catch-all with index and no trailing slash'
,
async
()
=>
{
const
data
=
await
fetchViaHTTP
(
appPort
,
'/api/users'
,
null
,
{}).
then
(
res
=>
res
.
ok
&&
res
.
json
()
(
res
)
=>
res
.
ok
&&
res
.
json
()
)
expect
(
data
).
toEqual
({})
...
...
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