-
-
Notifications
You must be signed in to change notification settings - Fork 320
/
issue26.js
43 lines (37 loc) · 1.08 KB
/
issue26.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import postcss from 'postcss';
import nano from '..';
import ava from 'ava';
const fixture = `
@media print {
.test {
-webkit-border-radius: 0;
border-radius: 0;
}
}
@media print {
.test {
-webkit-box-shadow: none;
box-shadow: none;
}
}
.test {
width: 500px;
}
`;
const expected = `@media print{.test{-webkit-box-shadow:none;box-shadow:none;-webkit-border-radius:0;border-radius:0}}.test{width:500px}`;
// Switch back once css-declaration-sorter has been fixed
// const expected = `@media print{.test{-webkit-border-radius:0;-webkit-box-shadow:none;border-radius:0;box-shadow:none}}.test{width:500px}`;
ava('it should compress whitespace after node.clone()', t => {
const processor = postcss([
postcss.plugin('cloner', () => {
return css => {
css.walkAtRules(rule => {
css.prepend(rule.clone());
rule.remove();
});
};
}),
nano(),
]);
return processor.process(fixture).then(r => t.deepEqual(r.css, expected));
});