Skip to content

Commit ca6eca0

Browse files
test: deprecation message (#915)
1 parent 955b863 commit ca6eca0

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

test/__snapshots__/loader.test.js.snap

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,26 @@ exports[`loader should work and ignore all css "@import" at-rules (node-sass) (s
18741874

18751875
exports[`loader should work and ignore all css "@import" at-rules (node-sass) (scss): warnings 1`] = `Array []`;
18761876

1877+
exports[`loader should work and output deprecation message (dart-sass): css 1`] = `
1878+
"a:hover {
1879+
color: rgba(0, 0, 0, 0.025);
1880+
}"
1881+
`;
1882+
1883+
exports[`loader should work and output deprecation message (dart-sass): css 2`] = `
1884+
"a:hover {
1885+
color: rgba(0, 0, 0, 0.025);
1886+
}"
1887+
`;
1888+
1889+
exports[`loader should work and output deprecation message (dart-sass): errors 1`] = `Array []`;
1890+
1891+
exports[`loader should work and output deprecation message (dart-sass): errors 2`] = `Array []`;
1892+
1893+
exports[`loader should work and output deprecation message (dart-sass): warnings 1`] = `Array []`;
1894+
1895+
exports[`loader should work and output deprecation message (dart-sass): warnings 2`] = `Array []`;
1896+
18771897
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:\\"∑\\"}"`;
18781898

18791899
exports[`loader should work and output the "compressed" outputStyle when "mode" is production (dart-sass) (sass): errors 1`] = `Array []`;

test/loader.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,22 @@ describe("loader", () => {
14531453
expect(getWarnings(stats)).toMatchSnapshot("warnings");
14541454
expect(getErrors(stats)).toMatchSnapshot("errors");
14551455
});
1456+
1457+
it(`should work and output deprecation message (${implementationName})`, async () => {
1458+
const testId = getTestId("deprecation", syntax);
1459+
const options = {
1460+
implementation: getImplementationByName(implementationName),
1461+
};
1462+
const compiler = getCompiler(testId, { loader: { options } });
1463+
const stats = await compile(compiler);
1464+
const codeFromBundle = getCodeFromBundle(stats, compiler);
1465+
const codeFromSass = getCodeFromSass(testId, options);
1466+
1467+
expect(codeFromBundle.css).toBe(codeFromSass.css);
1468+
expect(codeFromBundle.css).toMatchSnapshot("css");
1469+
expect(getWarnings(stats)).toMatchSnapshot("warnings");
1470+
expect(getErrors(stats)).toMatchSnapshot("errors");
1471+
});
14561472
}
14571473
});
14581474
});

test/sass/deprecation.sass

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
$side-nav-link-bg-hover: hsla(0, 0, 0%, 0.025) !default
2+
3+
a:hover
4+
color: $side-nav-link-bg-hover

test/scss/deprecation.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$side-nav-link-bg-hover: hsla(0, 0, 0%, 0.025) !default;
2+
3+
a:hover {
4+
color: $side-nav-link-bg-hover
5+
}

0 commit comments

Comments
 (0)