diff --git a/test/loader.test.js b/test/loader.test.js index ebc3cd4f..758ea3fa 100644 --- a/test/loader.test.js +++ b/test/loader.test.js @@ -1454,6 +1454,22 @@ describe("loader", () => { expect(getWarnings(stats)).toMatchSnapshot("warnings"); expect(getErrors(stats)).toMatchSnapshot("errors"); }); + + it(`should import .import.${syntax} files without .${syntax} file next to it (${implementationName}) (${syntax})`, async () => { + const testId = getTestId("only-import", syntax); + const options = { + implementation: getImplementationByName(implementationName), + }; + const compiler = getCompiler(testId, { loader: { options } }); + const stats = await compile(compiler); + const codeFromBundle = getCodeFromBundle(stats, compiler); + const codeFromSass = getCodeFromSass(testId, options); + + expect(codeFromBundle.css).toBe(codeFromSass.css); + expect(codeFromBundle.css).toMatchSnapshot("css"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + }); } }); }); diff --git a/test/node_modules/only-import/_index.import.scss b/test/node_modules/only-import/_index.import.scss new file mode 100644 index 00000000..d1308905 --- /dev/null +++ b/test/node_modules/only-import/_index.import.scss @@ -0,0 +1,3 @@ +a { + display: block; +} diff --git a/test/node_modules/only-import/package.json b/test/node_modules/only-import/package.json new file mode 100644 index 00000000..9988c74e --- /dev/null +++ b/test/node_modules/only-import/package.json @@ -0,0 +1,11 @@ +{ + "name": "only-import", + "version": "1.0.0", + "description": "test", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "MIT" +} diff --git a/test/sass/only-import.sass b/test/sass/only-import.sass new file mode 100644 index 00000000..10428ec0 --- /dev/null +++ b/test/sass/only-import.sass @@ -0,0 +1 @@ +@import '~only-import' diff --git a/test/scss/only-import.scss b/test/scss/only-import.scss new file mode 100644 index 00000000..fe2dbdab --- /dev/null +++ b/test/scss/only-import.scss @@ -0,0 +1 @@ +@import '~only-import';