File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,30 @@ describe("constants", () => {
6262 ":export {\n blue: red;\n}\n.foo { color: red; }"
6363 ) ) ;
6464
65+ it ( "should replace constants within the file #1" , ( ) =>
66+ test (
67+ "@value blue: red; .foo { &.bar { color: blue; } }" ,
68+ ":export {\n blue: red;\n} .foo { &.bar { color: red; } }"
69+ ) ) ;
70+
71+ it ( "should replace constants within the file #2" , ( ) =>
72+ test (
73+ "@value blue: red; .foo { @media (min-width: 1024px) { &.bar { color: blue; } } }" ,
74+ ":export {\n blue: red;\n} .foo { @media (min-width: 1024px) { &.bar { color: red; } } }"
75+ ) ) ;
76+
77+ it ( "should replace constants within the file #3" , ( ) =>
78+ test (
79+ "@value blue: red; .foo { @media (min-width: 1024px) { &.bar { @media (min-width: 1024px) { color: blue; } } } }" ,
80+ ":export {\n blue: red;\n} .foo { @media (min-width: 1024px) { &.bar { @media (min-width: 1024px) { color: red; } } } }"
81+ ) ) ;
82+
83+ it ( "should replace constants within the file #4" , ( ) =>
84+ test (
85+ "@value test-t: 40px;\n@value test_q: 36px; .foo { height: test-t; height: test_q; }" ,
86+ ":export {\n test-t: 40px;\n test_q: 36px;\n}\n.foo { height: 40px; height: 36px; }"
87+ ) ) ;
88+
6589 it ( "should replace selectors within the file" , ( ) =>
6690 test (
6791 "@value colorValue: red; .colorValue { color: colorValue; }" ,
You can’t perform that action at this time.
0 commit comments