-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
60 lines (57 loc) · 1.24 KB
/
index.test.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const postcss = require("postcss");
const plugin = require("./");
async function run(input, output, opts = {}) {
let result = await postcss([plugin(opts)]).process(input, {
from: undefined,
});
expect(result.css.replace(/(?:\r\n|\r|\n| )/g, "")).toEqual(
output.replace(/(?:\r\n|\r|\n| )/g, "")
);
expect(result.warnings()).toHaveLength(0);
}
it("does something", async () => {
await run(
`
a {
stepped-font-size: 80px, 20px, (576px, 768px, 992px, 1200px, 1400px);
}
`,
`
a {
min-width: 0vw;
line-height: normal;
}
@media (max-width: 576px) {
a {
font-size: 20px;
}
}
@media (min-width: 576px) and (max-width: 768px) {
a {
font-size: 34px;
}
}
@media (min-width: 768px) and (max-width: 992px) {
a {
font-size: 50.3px;
}
}
@media (min-width: 992px) and (max-width: 1200px) {
a {
font-size: 65.4px;
}
}
@media (min-width: 1200px) and (max-width: 1400px) {
a {
font-size: 80px;
}
}
@media (min-width: 1400px) {
a {
font-size: 80px;
}
}
`,
{}
);
});