-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
42 lines (38 loc) · 890 Bytes
/
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
var postcss = require('postcss');
var plugin = require('./');
function run(input, output, opts) {
return postcss([ plugin(opts) ]).process(input)
.then(result => {
expect(result.css).toEqual(output);
expect(result.warnings().length).toBe(0);
});
}
var input =
`.el {
display: block;
transition: opacity .3s ease;
transition: transform .5s ease;
opacity: .7;
}
@media (max-width: 34em) {
.other-el{
width: 100%;
transition: color .3s ease;
transition: background .5s ease;
}
}`;
var output =
`.el {
display: block;
opacity: .7;
transition: opacity .3s ease, transform .5s ease;
}
@media (max-width: 34em) {
.other-el{
width: 100%;
transition: color .3s ease, background .5s ease;
}
}`;
it('merges transitions', () => {
return run(input, output, { });
});