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
ee164dae
Commit
ee164dae
authored
Aug 29, 2025
by
devjiwonchoi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: improve import json edge case
parent
2a73ab0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
+27
-3
next-config-ts-import-json-cjs.test.ts
...fig-ts/import-json/next-config-ts-import-json-cjs.test.ts
+10
-1
next-config-ts-import-json-esm.test.ts
...fig-ts/import-json/next-config-ts-import-json-esm.test.ts
+10
-1
next.config.ts
test/e2e/app-dir/next-config-ts/import-json/next.config.ts
+3
-0
object.json
test/e2e/app-dir/next-config-ts/import-json/object.json
+4
-1
No files found.
test/e2e/app-dir/next-config-ts/import-json/next-config-ts-import-json-cjs.test.ts
View file @
ee164dae
...
...
@@ -7,6 +7,15 @@ describe('next-config-ts-import-json-cjs', () => {
it
(
'should support import json (CJS)'
,
async
()
=>
{
const
$
=
await
next
.
render$
(
'/'
)
expect
(
$
(
'p'
).
text
()).
toBe
(
JSON
.
stringify
([
'object'
,
'object'
,
'array'
]))
expect
(
$
(
'p'
).
text
()).
toBe
(
JSON
.
stringify
([
'object'
,
'123'
,
'with space'
,
'with-hyphen'
,
'object'
,
'array'
,
])
)
})
})
test/e2e/app-dir/next-config-ts/import-json/next-config-ts-import-json-esm.test.ts
View file @
ee164dae
...
...
@@ -10,6 +10,15 @@ describe('next-config-ts-import-json-esm', () => {
it
(
'should support import json (ESM)'
,
async
()
=>
{
const
$
=
await
next
.
render$
(
'/'
)
expect
(
$
(
'p'
).
text
()).
toBe
(
JSON
.
stringify
([
'object'
,
'object'
,
'array'
]))
expect
(
$
(
'p'
).
text
()).
toBe
(
JSON
.
stringify
([
'object'
,
'123'
,
'with space'
,
'with-hyphen'
,
'object'
,
'array'
,
])
)
})
})
test/e2e/app-dir/next-config-ts/import-json/next.config.ts
View file @
ee164dae
...
...
@@ -6,6 +6,9 @@ import jsonArray from './array.json'
export
default
{
env
:
{
jsonObjDefault
:
jsonObjDefault
.
object
,
jsonObjDefault123
:
String
(
jsonObjDefault
[
'123number'
]),
jsonObjDefaultWithSpace
:
jsonObjDefault
[
'with space'
],
jsonObjDefaultWithHyphen
:
jsonObjDefault
[
'with-hyphen'
],
jsonObjNamed
,
jsonArray
:
jsonArray
[
0
].
array
,
},
...
...
test/e2e/app-dir/next-config-ts/import-json/object.json
View file @
ee164dae
{
"object"
:
"object"
"object"
:
"object"
,
"123number"
:
123
,
"with space"
:
"with space"
,
"with-hyphen"
:
"with-hyphen"
}
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