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
1813576d
Commit
1813576d
authored
Aug 29, 2025
by
devjiwonchoi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: update import-json for assertion
parent
eab3f4d5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
14 deletions
+30
-14
page.tsx
test/e2e/app-dir/next-config-ts/import-json-cjs/app/page.tsx
+3
-0
page.tsx
test/e2e/app-dir/next-config-ts/import-json-esm/app/page.tsx
+11
-1
array.json
test/e2e/app-dir/next-config-ts/import-json-esm/array.json
+1
-0
foo.json
test/e2e/app-dir/next-config-ts/import-json-esm/foo.json
+0
-3
next-config-ts-import-json-esm.test.ts
...ts/import-json-esm/next-config-ts-import-json-esm.test.ts
+1
-8
next.config.ts
...e2e/app-dir/next-config-ts/import-json-esm/next.config.ts
+8
-2
object.json
test/e2e/app-dir/next-config-ts/import-json-esm/object.json
+6
-0
No files found.
test/e2e/app-dir/next-config-ts/import-json-cjs/app/page.tsx
View file @
1813576d
...
@@ -3,6 +3,9 @@ export default function Page() {
...
@@ -3,6 +3,9 @@ export default function Page() {
<
p
>
<
p
>
{
JSON
.
stringify
([
{
JSON
.
stringify
([
process
.
env
.
jsonObjDefault
,
process
.
env
.
jsonObjDefault
,
process
.
env
.
jsonObjDefault123
,
process
.
env
.
jsonObjDefaultWithSpace
,
process
.
env
.
jsonObjDefaultWithHyphen
,
process
.
env
.
jsonObjNamed
,
process
.
env
.
jsonObjNamed
,
process
.
env
.
jsonArray
,
process
.
env
.
jsonArray
,
])
}
])
}
...
...
test/e2e/app-dir/next-config-ts/import-json-esm/app/page.tsx
View file @
1813576d
export
default
function
Page
()
{
export
default
function
Page
()
{
return
<
p
>
{
process
.
env
.
foo
}
</
p
>
return
(
<
p
>
{
JSON
.
stringify
([
process
.
env
.
jsonObjDefault
,
process
.
env
.
jsonObjDefault123
,
process
.
env
.
jsonObjDefaultWithSpace
,
process
.
env
.
jsonObjDefaultWithHyphen
,
process
.
env
.
jsonArray
,
])
}
</
p
>
)
}
}
test/e2e/app-dir/next-config-ts/import-json-esm/array.json
0 → 100644
View file @
1813576d
[{
"array"
:
"array"
}]
test/e2e/app-dir/next-config-ts/import-json-esm/foo.json
deleted
100644 → 0
View file @
eab3f4d5
{
"foo"
:
"foo"
}
test/e2e/app-dir/next-config-ts/import-json-esm/next-config-ts-import-json-esm.test.ts
View file @
1813576d
...
@@ -11,14 +11,7 @@ describe('next-config-ts-import-json-esm', () => {
...
@@ -11,14 +11,7 @@ describe('next-config-ts-import-json-esm', () => {
it
(
'should support import json (ESM)'
,
async
()
=>
{
it
(
'should support import json (ESM)'
,
async
()
=>
{
const
$
=
await
next
.
render$
(
'/'
)
const
$
=
await
next
.
render$
(
'/'
)
expect
(
$
(
'p'
).
text
()).
toBe
(
expect
(
$
(
'p'
).
text
()).
toBe
(
JSON
.
stringify
([
JSON
.
stringify
([
'object'
,
'123'
,
'with space'
,
'with-hyphen'
,
'array'
])
'object'
,
'123'
,
'with space'
,
'with-hyphen'
,
'object'
,
'array'
,
])
)
)
})
})
})
})
test/e2e/app-dir/next-config-ts/import-json-esm/next.config.ts
View file @
1813576d
import
type
{
NextConfig
}
from
'next'
import
type
{
NextConfig
}
from
'next'
import
fooJson
from
'./foo.json'
with
{
type
:
'json'
}
import
jsonObjDefault
from
'./object.json'
with
{
type
:
'json'
}
import
jsonArray
from
'./array.json'
with
{
type
:
'json'
}
// ESM doesn't support named imports from JSON files.
export
default
{
export
default
{
env
:
{
env
:
{
foo
:
fooJson
.
foo
,
jsonObjDefault
:
jsonObjDefault
.
object
,
jsonObjDefault123
:
String
(
jsonObjDefault
[
'123number'
]),
jsonObjDefaultWithSpace
:
jsonObjDefault
[
'with space'
],
jsonObjDefaultWithHyphen
:
jsonObjDefault
[
'with-hyphen'
],
jsonArray
:
jsonArray
[
0
].
array
,
},
},
}
satisfies
NextConfig
}
satisfies
NextConfig
test/e2e/app-dir/next-config-ts/import-json-esm/object.json
0 → 100644
View file @
1813576d
{
"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