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
d9712626
Unverified
Commit
d9712626
authored
Nov 22, 2021
by
Tobias Koppers
Committed by
GitHub
Nov 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test case (#31691)
fixes #30567
parent
feabd54f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
0 deletions
+53
-0
_app.js
test/integration/scss-fixtures/external-url/pages/_app.js
+12
-0
index.js
test/integration/scss-fixtures/external-url/pages/index.js
+3
-0
global.scss
...integration/scss-fixtures/external-url/styles/global.scss
+9
-0
index.test.js
test/integration/scss/test/index.test.js
+29
-0
No files found.
test/integration/scss-fixtures/external-url/pages/_app.js
0 → 100644
View file @
d9712626
import
React
from
'react'
import
App
from
'next/app'
import
'../styles/global.scss'
class
MyApp
extends
App
{
render
()
{
const
{
Component
,
pageProps
}
=
this
.
props
return
<
Component
{...
pageProps
}
/
>
}
}
export
default
MyApp
test/integration/scss-fixtures/external-url/pages/index.js
0 → 100644
View file @
d9712626
export
default
function
Home
()
{
return
<
div
className
=
"red-text"
>
This
text
should
be
red
.
<
/div
>
}
test/integration/scss-fixtures/external-url/styles/global.scss
0 → 100644
View file @
d9712626
$var
:
red
;
.red-text
{
color
:
$var
;
font-family
:
'Poppins'
;
font-style
:
normal
;
font-weight
:
400
;
}
@import
url('https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap')
;
test/integration/scss/test/index.test.js
View file @
d9712626
...
...
@@ -780,6 +780,35 @@ describe('SCSS Support', () => {
})
})
describe
(
'External imports'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'external-url'
)
beforeAll
(
async
()
=>
{
await
remove
(
join
(
appDir
,
'.next'
))
})
it
(
'should compile successfully'
,
async
()
=>
{
const
{
code
,
stdout
}
=
await
nextBuild
(
appDir
,
[],
{
stdout
:
true
,
})
expect
(
code
).
toBe
(
0
)
expect
(
stdout
).
toMatch
(
/Compiled successfully/
)
})
it
(
`should've emitted expected files`
,
async
()
=>
{
const
cssFolder
=
join
(
appDir
,
'.next/static/css'
)
const
files
=
await
readdir
(
cssFolder
)
const
cssFiles
=
files
.
filter
((
f
)
=>
/
\.
css$/
.
test
(
f
))
expect
(
cssFiles
.
length
).
toBe
(
1
)
const
cssContent
=
await
readFile
(
join
(
cssFolder
,
cssFiles
[
0
]),
'utf8'
)
expect
(
cssContent
.
replace
(
/
\/\*
.*
?\*\/
/g
,
''
).
trim
()).
toMatch
(
/^@import url
\(
"https:
\/\/
fonts
\.
googleapis
\.
com
\/
css2
\?
family=Poppins:wght@400&display=swap"
\)
;
\.
red-text
\{
color:red;font-family:Poppins;font-style:normal;font-weight:400
\}
$/
)
})
})
describe
(
'Good CSS Import from node_modules'
,
()
=>
{
const
appDir
=
join
(
fixturesDir
,
'npm-import'
)
...
...
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