Skip to content

Commit

Permalink
test: more
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed May 31, 2021
1 parent 7ca97ef commit 8a0bc0a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/__snapshots__/loader.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,24 @@ exports[`loader should load only sass/scss files for the "mainFiles" (node-sass)

exports[`loader should load only sass/scss files for the "mainFiles" (node-sass) (scss): warnings 1`] = `Array []`;

exports[`loader should not use .import.sass files (dart-sass) (sass): errors 1`] = `
Array [
"ModuleBuildError: Module build failed (from ../src/cjs.js):
SassError: Can't find stylesheet to import.",
]
`;

exports[`loader should not use .import.sass files (dart-sass) (sass): warnings 1`] = `Array []`;

exports[`loader should not use .import.scss files (dart-sass) (scss): errors 1`] = `
Array [
"ModuleBuildError: Module build failed (from ../src/cjs.js):
SassError: Can't find stylesheet to import.",
]
`;

exports[`loader should not use .import.scss files (dart-sass) (scss): warnings 1`] = `Array []`;

exports[`loader should output an understandable error (dart-sass) (sass): errors 1`] = `
Array [
"ModuleBuildError: Module build failed (from ../src/cjs.js):
Expand Down
12 changes: 12 additions & 0 deletions test/loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,18 @@ describe("loader", () => {
expect(getErrors(stats)).toMatchSnapshot("errors");
});

it(`should not use .import.${syntax} files (${implementationName}) (${syntax})`, async () => {
const testId = getTestId("use-index-import", syntax);
const options = {
implementation: getImplementationByName(implementationName),
};
const compiler = getCompiler(testId, { loader: { options } });
const stats = await compile(compiler);

expect(getWarnings(stats)).toMatchSnapshot("warnings");
expect(getErrors(stats)).toMatchSnapshot("errors");
});

it(`should work and output deprecation message (${implementationName})`, async () => {
const testId = getTestId("deprecation", syntax);
const options = {
Expand Down
1 change: 1 addition & 0 deletions test/sass/use-index-import.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@use 'index-import'
1 change: 1 addition & 0 deletions test/scss/use-index-import.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@use 'index-import';

0 comments on commit 8a0bc0a

Please sign in to comment.