forked from 7rulnik/postcss-flexibility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
53 lines (48 loc) · 874 Bytes
/
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
import postcss from 'postcss';
import test from 'ava';
import plugin from './';
function run(t, input, output) {
return postcss([plugin()]).process(input)
.then(result => {
t.deepEqual(result.css, output);
t.deepEqual(result.warnings().length, 0);
});
}
test('Add "-js-display: flex" if "display: flex" present', t => {
return run(
t,
`a {
display: flex;
}`,
`a {
-js-display: flex;
display: flex;
}`
);
});
test('Don\'add "-js-display: flex" if it\'s already exist', t => {
return run(
t,
`a {
-js-display: flex;
display: flex;
}`,
`a {
-js-display: flex;
display: flex;
}`
);
});
test('Don\'add "-js-display: flex" if comment "flexibility-disable" is exist', t => {
return run(
t,
`a {
/* flexibility-disable */
display: flex;
}`,
`a {
/* flexibility-disable */
display: flex;
}`
);
});