/
leadingUnderscore.js
70 lines (62 loc) · 1.33 KB
/
leadingUnderscore.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
61
62
63
64
65
66
67
68
69
70
import test from 'ava';
import processCSS from './_processCSS';
test(
'ie 6 underscore hack',
processCSS,
'h1 { _color: red }',
'h1 { }',
{target: 'ie6', unaffected: 'ie7'}
);
test(
'ie 6 underscore hack (uppercase)',
processCSS,
'h1 { _COLOR: red }',
'h1 { }',
{target: 'ie6', unaffected: 'ie7'}
);
test(
'ie 6 hyphen hack',
processCSS,
'h1 { -color: red }',
'h1 { }',
{target: 'ie6', unaffected: 'ie7'}
);
test(
'ie 6 hyphen hack (uppercase)',
processCSS,
'h1 { -COLOR: red }',
'h1 { }',
{target: 'ie6', unaffected: 'ie7'}
);
test(
'prefixed value must be ignored',
processCSS,
'h1 { -moz-tab-size: 10px }',
'h1 { -moz-tab-size: 10px }',
{target: 'ie6', unaffected: 'ie7'},
0
);
test(
'prefixed value must be ignored (uppercase)',
processCSS,
'h1 { -MOZ-TAB-SIZE: 10px }',
'h1 { -MOZ-TAB-SIZE: 10px }',
{target: 'ie6', unaffected: 'ie7'},
0
);
test(
'custom property must be ignored',
processCSS,
'h1 { --color-foobar: #000; }',
'h1 { --color-foobar: #000; }',
{target: 'ie6', unaffected: 'ie7'},
0
);
test(
'custom property must be ignored (uppercase)',
processCSS,
'h1 { --COLOR-FOOBAR: #000; }',
'h1 { --COLOR-FOOBAR: #000; }',
{target: 'ie6', unaffected: 'ie7'},
0
);