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", () => {
62
62
":export {\n blue: red;\n}\n.foo { color: red; }"
63
63
) ) ;
64
64
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
+
65
89
it ( "should replace selectors within the file" , ( ) =>
66
90
test (
67
91
"@value colorValue: red; .colorValue { color: colorValue; }" ,
You can’t perform that action at this time.
0 commit comments