-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
0330253
commit 6f4ea37
Showing
4 changed files
with
163 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`webpackImporter option false (dart-sass) (sass): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option false (dart-sass) (sass): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option false (dart-sass) (scss): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option false (dart-sass) (scss): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option false (node-sass) (sass): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option false (node-sass) (sass): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option false (node-sass) (scss): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option false (node-sass) (scss): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option not specify (dart-sass) (sass): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option not specify (dart-sass) (sass): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option not specify (dart-sass) (scss): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option not specify (dart-sass) (scss): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option not specify (node-sass) (sass): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option not specify (node-sass) (sass): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option not specify (node-sass) (scss): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option not specify (node-sass) (scss): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option true (dart-sass) (sass): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option true (dart-sass) (sass): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option true (dart-sass) (scss): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option true (dart-sass) (scss): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option true (node-sass) (sass): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option true (node-sass) (sass): warnings 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option true (node-sass) (scss): errors 1`] = `Array []`; | ||
|
||
exports[`webpackImporter option true (node-sass) (scss): warnings 1`] = `Array []`; |
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,71 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
import nodeSass from 'node-sass'; | ||
import dartSass from 'sass'; | ||
|
||
import { | ||
compile, | ||
getTestId, | ||
getCodeFromBundle, | ||
getCodeFromSass, | ||
getImplementationByName, | ||
} from './helpers'; | ||
|
||
const implementations = [nodeSass, dartSass]; | ||
const syntaxStyles = ['scss', 'sass']; | ||
|
||
describe('webpackImporter option', () => { | ||
implementations.forEach((implementation) => { | ||
syntaxStyles.forEach((syntax) => { | ||
const [implementationName] = implementation.info.split('\t'); | ||
|
||
it(`not specify (${implementationName}) (${syntax})`, async () => { | ||
const testId = getTestId('language', syntax); | ||
const options = { | ||
implementation: getImplementationByName(implementationName), | ||
}; | ||
const stats = await compile(testId, { loader: { options } }); | ||
|
||
expect(getCodeFromBundle(stats).css).toBe( | ||
getCodeFromSass(testId, options).css | ||
); | ||
|
||
expect(stats.compilation.warnings).toMatchSnapshot('warnings'); | ||
expect(stats.compilation.errors).toMatchSnapshot('errors'); | ||
}); | ||
|
||
it(`false (${implementationName}) (${syntax})`, async () => { | ||
const testId = getTestId('language', syntax); | ||
const options = { | ||
webpackImporter: false, | ||
implementation: getImplementationByName(implementationName), | ||
}; | ||
const stats = await compile(testId, { loader: { options } }); | ||
|
||
expect(getCodeFromBundle(stats).css).toBe( | ||
getCodeFromSass(testId, options).css | ||
); | ||
|
||
expect(stats.compilation.warnings).toMatchSnapshot('warnings'); | ||
expect(stats.compilation.errors).toMatchSnapshot('errors'); | ||
}); | ||
|
||
it(`true (${implementationName}) (${syntax})`, async () => { | ||
const testId = getTestId('language', syntax); | ||
const options = { | ||
webpackImporter: true, | ||
implementation: getImplementationByName(implementationName), | ||
}; | ||
const stats = await compile(testId, { loader: { options } }); | ||
|
||
expect(getCodeFromBundle(stats).css).toBe( | ||
getCodeFromSass(testId, options).css | ||
); | ||
|
||
expect(stats.compilation.warnings).toMatchSnapshot('warnings'); | ||
expect(stats.compilation.errors).toMatchSnapshot('errors'); | ||
}); | ||
}); | ||
}); | ||
}); |