diff --git a/test/__snapshots__/loader.test.js.snap b/test/__snapshots__/loader.test.js.snap index 9adb7096..1d812da3 100644 --- a/test/__snapshots__/loader.test.js.snap +++ b/test/__snapshots__/loader.test.js.snap @@ -1874,6 +1874,26 @@ exports[`loader should work and ignore all css "@import" at-rules (node-sass) (s exports[`loader should work and ignore all css "@import" at-rules (node-sass) (scss): warnings 1`] = `Array []`; +exports[`loader should work and output deprecation message (dart-sass): css 1`] = ` +"a:hover { + color: rgba(0, 0, 0, 0.025); +}" +`; + +exports[`loader should work and output deprecation message (dart-sass): css 2`] = ` +"a:hover { + color: rgba(0, 0, 0, 0.025); +}" +`; + +exports[`loader should work and output deprecation message (dart-sass): errors 1`] = `Array []`; + +exports[`loader should work and output deprecation message (dart-sass): errors 2`] = `Array []`; + +exports[`loader should work and output deprecation message (dart-sass): warnings 1`] = `Array []`; + +exports[`loader should work and output deprecation message (dart-sass): warnings 2`] = `Array []`; + exports[`loader should work and output the "compressed" outputStyle when "mode" is production (dart-sass) (sass): css 1`] = `"@import\\"./file.css\\";body{font:100% Helvetica,sans-serif;color:#333}nav ul{margin:0;padding:0;list-style:none}nav li{display:inline-block}nav a{display:block;padding:6px 12px;text-decoration:none}.box{-webkit-border-radius:10px;-moz-border-radius:10px;-ms-border-radius:10px;border-radius:10px}.message,.warning,.error,.success{border:1px solid #ccc;padding:10px;color:#333}.success{border-color:green}.error{border-color:red}.warning{border-color:#ff0}.foo:before{content:\\"\\"}.bar:before{content:\\"∑\\"}"`; exports[`loader should work and output the "compressed" outputStyle when "mode" is production (dart-sass) (sass): errors 1`] = `Array []`; diff --git a/test/loader.test.js b/test/loader.test.js index 1fdda94b..0ead5aed 100644 --- a/test/loader.test.js +++ b/test/loader.test.js @@ -1453,6 +1453,22 @@ describe("loader", () => { 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 = { + 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/sass/deprecation.sass b/test/sass/deprecation.sass new file mode 100644 index 00000000..e7a8f5c1 --- /dev/null +++ b/test/sass/deprecation.sass @@ -0,0 +1,4 @@ +$side-nav-link-bg-hover: hsla(0, 0, 0%, 0.025) !default + +a:hover + color: $side-nav-link-bg-hover \ No newline at end of file diff --git a/test/scss/deprecation.scss b/test/scss/deprecation.scss new file mode 100644 index 00000000..7eab57ac --- /dev/null +++ b/test/scss/deprecation.scss @@ -0,0 +1,5 @@ +$side-nav-link-bg-hover: hsla(0, 0, 0%, 0.025) !default; + +a:hover { + color: $side-nav-link-bg-hover +} \ No newline at end of file