-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: STRF-9749 Update Stencil Cli to use node-sass latest by default
- Loading branch information
Showing
30 changed files
with
458 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const path = require('path'); | ||
const { promisify } = require('util'); | ||
|
||
const ThemeConfig = require('./theme-config'); | ||
const BundleValidator = require('./bundle-validator'); | ||
const stencilCLISettings = require('./StencilCLISettings'); | ||
|
||
// NOTE: | ||
// Since stencil styles can't change node sass engine in runtime, tests are divided into 2 files | ||
// Jest runs tests in parallel, so the node sass binaries are not conflicting and we are able to test both scenarios | ||
// | ||
// Skipping this test until multiple core are supported no Github Actions | ||
describe.skip('BundleValidator', () => { | ||
afterEach(() => { | ||
jest.restoreAllMocks(); | ||
stencilCLISettings.useOldNodeSassFork(false); | ||
}); | ||
|
||
it('should compile successfully with old node sass fork', async () => { | ||
const themePath = path.join( | ||
process.cwd(), | ||
'test/_mocks/themes/invalid-scss-latest-node-sass', | ||
); | ||
const themeConfig = ThemeConfig.getInstance(themePath); | ||
stencilCLISettings.useOldNodeSassFork(true); | ||
|
||
const validator = new BundleValidator(themePath, themeConfig, false); | ||
|
||
const result = await promisify(validator.validateTheme.bind(validator))(); | ||
expect(result).not.toBeNull(); | ||
}); | ||
}); |
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
3 changes: 3 additions & 0 deletions
3
test/_mocks/themes/invalid-scss-latest-node-sass/assets/scss/test.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,3 @@ | ||
h1 { | ||
color: #000000; | ||
} |
9 changes: 9 additions & 0 deletions
9
test/_mocks/themes/invalid-scss-latest-node-sass/assets/scss/theme.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,9 @@ | ||
h1 { | ||
color: #0000AA; | ||
} | ||
|
||
$font: "Arial"; | ||
|
||
@if not contains($font, "'Clear Sans', sans-serif") { | ||
@import "test"; | ||
} |
Oops, something went wrong.