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
db2c7bf7
Unverified
Commit
db2c7bf7
authored
Sep 09, 2025
by
Niklas Mischkulnig
Committed by
GitHub
Sep 09, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable more tests for Turbopack (#83589)
parent
928c4db7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
96 deletions
+82
-96
invalid-module-document.test.ts
...s/invalid-module-document/invalid-module-document.test.ts
+1
-1
valid-invalid-css.test.js
test/integration/css/test/valid-invalid-css.test.js
+81
-95
No files found.
test/e2e/app-dir/scss/invalid-module-document/invalid-module-document.test.ts
View file @
db2c7bf7
...
...
@@ -6,7 +6,7 @@ import { join } from 'path'
// In order for the global isNextStart to be set
import
'e2e-utils'
//
TODO: Implement warning for
Turbopack
//
Importing module CSS in _document is allowed in
Turbopack
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
'Invalid SCSS in _document'
,
()
=>
{
...
...
test/integration/css/test/valid-invalid-css.test.js
View file @
db2c7bf7
...
...
@@ -13,7 +13,7 @@ import { join } from 'path'
const
fixturesDir
=
join
(
__dirname
,
'../..'
,
'css-fixtures'
)
//
TODO: Implement warning for
Turbopack
//
Importing module CSS in _document is allowed in
Turbopack
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
'Invalid CSS in _document'
,
()
=>
{
...
...
@@ -45,38 +45,36 @@ const fixturesDir = join(__dirname, '../..', 'css-fixtures')
)
}
)
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
'Invalid Global CSS'
,
()
=>
{
;(
process
.
env
.
TURBOPACK_DEV
?
describe
.
skip
:
describe
)(
'production mode'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'invalid-global'
)
beforeAll
(
async
()
=>
{
await
remove
(
join
(
appDir
,
'.next'
))
})
describe
(
'Invalid Global CSS'
,
()
=>
{
;(
process
.
env
.
TURBOPACK_DEV
?
describe
.
skip
:
describe
)(
'production mode'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'invalid-global'
)
// eslint-disable-next-line jest/no-identical-title
it
(
'should fail to build'
,
async
()
=>
{
const
{
code
,
stderr
}
=
await
nextBuild
(
appDir
,
[],
{
stderr
:
true
,
})
expect
(
code
).
not
.
toBe
(
0
)
expect
(
stderr
).
toContain
(
'Failed to compile'
)
expect
(
stderr
).
toContain
(
'styles/global.css'
)
expect
(
stderr
).
toMatch
(
/Please move all first-party global CSS imports.*
?
pages
(\/
|
\\)
_app/
)
// Skip: Rspack loaders cannot access module issuer info for location details
if
(
!
process
.
env
.
NEXT_RSPACK
)
{
expect
(
stderr
).
toMatch
(
/Location:.*pages
[\\/]
index
\.
js/
)
}
beforeAll
(
async
()
=>
{
await
remove
(
join
(
appDir
,
'.next'
))
})
// eslint-disable-next-line jest/no-identical-title
it
(
'should fail to build'
,
async
()
=>
{
const
{
code
,
stderr
}
=
await
nextBuild
(
appDir
,
[],
{
stderr
:
true
,
})
}
)
}
)
expect
(
code
).
not
.
toBe
(
0
)
expect
(
stderr
).
toContain
(
'Failed to compile'
)
expect
(
stderr
).
toContain
(
'styles/global.css'
)
expect
(
stderr
).
toMatch
(
/Please move all first-party global CSS imports.*
?
pages
(\/
|
\\)
_app/
)
// Skip: Rspack loaders cannot access module issuer info for location details
if
(
!
process
.
env
.
NEXT_RSPACK
)
{
expect
(
stderr
).
toMatch
(
/Location:.*pages
[\\/]
index
\.
js/
)
}
})
}
)
})
describe
(
'Valid Global CSS from npm'
,
()
=>
{
;(
process
.
env
.
TURBOPACK_DEV
?
describe
.
skip
:
describe
)(
...
...
@@ -114,80 +112,68 @@ describe('Valid Global CSS from npm', () => {
.
replace
(
/
\/\*
.*
?\*\/
/g
,
''
)
.
trim
()
if
(
process
.
env
.
IS_TURBOPACK_TEST
)
{
expect
(
cssContent
).
toMatchInlineSnapshot
(
`".red-text{color:"red"}"`
)
}
else
{
expect
(
cssContent
).
toMatchInlineSnapshot
(
`".red-text{color:"red"}"`
)
}
expect
(
cssContent
).
toMatchInlineSnapshot
(
`".red-text{color:"red"}"`
)
})
}
)
})
// TODO: Implement warning for Turbopack
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
'Invalid Global CSS with Custom App'
,
()
=>
{
;(
process
.
env
.
TURBOPACK_DEV
?
describe
.
skip
:
describe
)(
'production mode'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'invalid-global-with-app'
)
describe
(
'Invalid Global CSS with Custom App'
,
()
=>
{
;(
process
.
env
.
TURBOPACK_DEV
?
describe
.
skip
:
describe
)(
'production mode'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'invalid-global-with-app'
)
beforeAll
(
async
()
=>
{
await
remove
(
join
(
appDir
,
'.next'
))
})
beforeAll
(
async
()
=>
{
await
remove
(
join
(
appDir
,
'.next'
))
})
// eslint-disable-next-line jest/no-identical-title
it
(
'should fail to build'
,
async
()
=>
{
const
{
code
,
stderr
}
=
await
nextBuild
(
appDir
,
[],
{
stderr
:
true
,
})
expect
(
code
).
not
.
toBe
(
0
)
expect
(
stderr
).
toContain
(
'Failed to compile'
)
expect
(
stderr
).
toContain
(
'styles/global.css'
)
expect
(
stderr
).
toMatch
(
/Please move all first-party global CSS imports.*
?
pages
(\/
|
\\)
_app/
)
// Skip: Rspack loaders cannot access module issuer info for location details
if
(
!
process
.
env
.
NEXT_RSPACK
)
{
expect
(
stderr
).
toMatch
(
/Location:.*pages
[\\/]
index
\.
js/
)
}
// eslint-disable-next-line jest/no-identical-title
it
(
'should fail to build'
,
async
()
=>
{
const
{
code
,
stderr
}
=
await
nextBuild
(
appDir
,
[],
{
stderr
:
true
,
})
}
)
}
)
expect
(
code
).
not
.
toBe
(
0
)
expect
(
stderr
).
toContain
(
'Failed to compile'
)
expect
(
stderr
).
toContain
(
'styles/global.css'
)
expect
(
stderr
).
toMatch
(
/Please move all first-party global CSS imports.*
?
pages
(\/
|
\\)
_app/
)
// Skip: Rspack loaders cannot access module issuer info for location details
if
(
!
process
.
env
.
NEXT_RSPACK
)
{
expect
(
stderr
).
toMatch
(
/Location:.*pages
[\\/]
index
\.
js/
)
}
})
}
)
})
// TODO: Implement warning for Turbopack
;(
process
.
env
.
IS_TURBOPACK_TEST
?
describe
.
skip
:
describe
)(
'Valid and Invalid Global CSS with Custom App'
,
()
=>
{
;(
process
.
env
.
TURBOPACK_DEV
?
describe
.
skip
:
describe
)(
'production mode'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'valid-and-invalid-global'
)
describe
(
'Valid and Invalid Global CSS with Custom App'
,
()
=>
{
;(
process
.
env
.
TURBOPACK_DEV
?
describe
.
skip
:
describe
)(
'production mode'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'valid-and-invalid-global'
)
beforeAll
(
async
()
=>
{
await
remove
(
join
(
appDir
,
'.next'
))
})
beforeAll
(
async
()
=>
{
await
remove
(
join
(
appDir
,
'.next'
))
})
// eslint-disable-next-line jest/no-identical-title
it
(
'should fail to build'
,
async
()
=>
{
const
{
code
,
stderr
}
=
await
nextBuild
(
appDir
,
[],
{
stderr
:
true
,
})
expect
(
code
).
not
.
toBe
(
0
)
expect
(
stderr
).
toContain
(
'Failed to compile'
)
expect
(
stderr
).
toContain
(
'styles/global.css'
)
expect
(
stderr
).
toContain
(
'Please move all first-party global CSS imports'
)
// Skip: Rspack loaders cannot access module issuer info for location details
if
(
!
process
.
env
.
NEXT_RSPACK
)
{
expect
(
stderr
).
toMatch
(
/Location:.*pages
[\\/]
index
\.
js/
)
}
// eslint-disable-next-line jest/no-identical-title
it
(
'should fail to build'
,
async
()
=>
{
const
{
code
,
stderr
}
=
await
nextBuild
(
appDir
,
[],
{
stderr
:
true
,
})
}
)
}
)
expect
(
code
).
not
.
toBe
(
0
)
expect
(
stderr
).
toContain
(
'Failed to compile'
)
expect
(
stderr
).
toContain
(
'styles/global.css'
)
expect
(
stderr
).
toContain
(
'Please move all first-party global CSS imports'
)
// Skip: Rspack loaders cannot access module issuer info for location details
if
(
!
process
.
env
.
NEXT_RSPACK
)
{
expect
(
stderr
).
toMatch
(
/Location:.*pages
[\\/]
index
\.
js/
)
}
})
}
)
})
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