-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.test.js
More file actions
41 lines (35 loc) · 809 Bytes
/
index.test.js
File metadata and controls
41 lines (35 loc) · 809 Bytes
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
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);
});
}
test('change: light color', () => {
return run(
'a{color:#eee}',
'a{color:#eee;-webkit-font-smoothing:antialiased}'
);
});
test('no change: dark color', () => {
return run(
'a{color:#222}',
'a{color:#222}'
);
});
test('change: custom luminance', () => {
return run(
'a{color:#ddd}',
'a{color:#ddd;-webkit-font-smoothing:antialiased}',
{ luminance: 0.7 }
);
});
test('no change: custom luminance', () => {
return run(
'a{color:#ccc}',
'a{color:#ccc}',
{ luminance: 0.7 }
);
});