Skip to content

Commit 0ccfb82

Browse files
committed
test: added test with css custom properties
Add test for CSS custom properties and fix spelling mistakes
1 parent fc9e585 commit 0ccfb82

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

test/duplicated-properties.js

+24-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const plugin = require('../src');
88
*/
99

1010
/**
11-
* Take string literals are remove newlines and extra spacing so results print
11+
* Take string literals and remove newlines and extra spacing so results print
1212
* as expected in logs
1313
* @return {string} string without newlines and tabs
1414
*/
@@ -23,7 +23,7 @@ const removeDuplicates = testFactory(
2323
);
2424

2525
test(
26-
'remove duplicated properties when combine selectors',
26+
'remove duplicated properties when combining selectors',
2727
removeDuplicates,
2828
'.a {height: 10px; color: black;} .a {color: blue; width: 20px;}',
2929
'.a {height: 10px;color: blue; width: 20px;}',
@@ -54,7 +54,7 @@ const keepDuplicates = testFactory(
5454
);
5555

5656
test(
57-
'maintain duplicated properties when combine selectors',
57+
'maintain duplicated properties when combining selectors',
5858
keepDuplicates,
5959
'.a {height: 10px; color: black;} .a {color: blue; width: 20px;}',
6060
'.a {height: 10px; color: black;color: blue; width: 20px;}',
@@ -86,7 +86,7 @@ const removeExactDuplicates = testFactory(
8686
);
8787

8888
test(
89-
'remove duplicated properties with matching values when combine selectors',
89+
'remove duplicated properties with matching values with combined selectors',
9090
removeExactDuplicates,
9191
'.a {height: 10px; color: red;} .a {color: red; color: blue; width: 20px;}',
9292
'.a {height: 10px;color: red; color: blue; width: 20px;}',
@@ -111,3 +111,23 @@ test(
111111
}
112112
`,
113113
);
114+
115+
test(
116+
'remove duplicate property with matching value, allow fallback',
117+
removeExactDuplicates,
118+
minify`
119+
.a {
120+
height: 10px;
121+
}
122+
.a {
123+
height: 10px;
124+
height: var(--linkHeight);
125+
}
126+
`,
127+
minify`
128+
.a {
129+
height: 10px;
130+
height: var(--linkHeight);
131+
}
132+
`,
133+
);

0 commit comments

Comments
 (0)