-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0cbc079
commit c47e92b
Showing
10 changed files
with
150 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -294,6 +294,7 @@ | |
"react-refresh": "0.12.0", | ||
"regenerator-runtime": "0.13.4", | ||
"sass-loader": "15.0.0", | ||
"sass-loader-16": "npm:[email protected]", | ||
"schema-utils2": "npm:[email protected]", | ||
"schema-utils3": "npm:[email protected]", | ||
"semver": "7.3.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
test/e2e/app-dir/scss/use-upgraded-loader/basic-module.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { nextTestSetup } from 'e2e-utils' | ||
import { colorToRgb } from 'next-test-utils' | ||
|
||
describe('Legacy sass-loader', () => { | ||
const { next: nextWithLegacyLoader } = nextTestSetup({ | ||
files: __dirname, | ||
dependencies: { sass: '1.54.0' }, | ||
nextConfig: undefined, | ||
}) | ||
|
||
it('should render the module for the legacy sass-loader', async () => { | ||
const browser = await nextWithLegacyLoader.browser('/') | ||
expect( | ||
await browser.elementByCss('#verify-red').getComputedCss('color') | ||
).toBe(colorToRgb('red')) | ||
}) | ||
|
||
it('should show deprecation warning', async () => { | ||
expect(nextWithLegacyLoader.cliOutput).toContain( | ||
'Deprecation: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0' | ||
) | ||
}) | ||
}) | ||
|
||
describe('Upgraded sass-loader', () => { | ||
const { next: nextWithUpgradedLoader } = nextTestSetup({ | ||
files: __dirname, | ||
dependencies: { sass: '1.54.0' }, | ||
nextConfig: { | ||
experimental: { | ||
useUpgradedLoader: true, | ||
}, | ||
}, | ||
}) | ||
|
||
it('should render the module for the upgraded sass-loader', async () => { | ||
const browser = await nextWithUpgradedLoader.browser('/') | ||
expect( | ||
await browser.elementByCss('#verify-red').getComputedCss('color') | ||
).toBe(colorToRgb('red')) | ||
}) | ||
|
||
it('should not show deprecation warning', async () => { | ||
expect(nextWithUpgradedLoader.cliOutput).not.toContain( | ||
'Deprecation: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0' | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { redText } from './index.module.scss' | ||
|
||
export default function Home() { | ||
return ( | ||
<div id="verify-red" className={redText}> | ||
This text should be red. | ||
</div> | ||
) | ||
} |
4 changes: 4 additions & 0 deletions
4
test/e2e/app-dir/scss/use-upgraded-loader/pages/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$var: red; | ||
.redText { | ||
color: $var; | ||
} |