@@ -2,7 +2,8 @@ import test from 'ava';
2
2
import postcss from 'postcss' ;
3
3
import plugin from '../src' ;
4
4
5
- const processing = ( inputCSS , options ) => postcss ( [ plugin ( options ) ] ) . process ( inputCSS ) . css ;
5
+ const processing = ( inputCSS , options ) =>
6
+ postcss ( [ plugin ( options ) ] ) . process ( inputCSS ) . css ;
6
7
7
8
test ( 'processing not options and not attribute selector' , t => {
8
9
const expected = '.class, .test { color:red; }' ;
@@ -17,8 +18,10 @@ test('processing options prefix and not attribute selector', t => {
17
18
} ) ;
18
19
19
20
test ( 'processing options prefix multiple' , t => {
20
- const expected = '.class, [type="test-text"], [class*="test-lorem-1 test-lorem-2"], [id^="test-myID"] { color:red; }' ;
21
- const fixtures = '.class, [type="text"], [class*="lorem-1 lorem-2"], [id^="myID"] { color:red; }' ;
21
+ const expected =
22
+ '.class, [type="test-text"], [class*="test-lorem-1 test-lorem-2"], [id^="test-myID"] { color:red; }' ;
23
+ const fixtures =
24
+ '.class, [type="text"], [class*="lorem-1 lorem-2"], [id^="myID"] { color:red; }' ;
22
25
t . is ( processing ( fixtures , { prefix : 'test-' } ) , expected ) ;
23
26
} ) ;
24
27
@@ -29,46 +32,63 @@ test('processing options prefix and attribute selector', t => {
29
32
} ) ;
30
33
31
34
test ( 'processing options prefix, filter and attribute selector' , t => {
32
- const expected = '.class, [type="text"], [class*="test-lorem"] { color:red; }' ;
35
+ const expected =
36
+ '.class, [type="text"], [class*="test-lorem"] { color:red; }' ;
33
37
const fixtures = '.class, [type="text"], [class*="lorem"] { color:red; }' ;
34
- t . is ( processing ( fixtures , {
35
- prefix : 'test-' ,
36
- filter : [ 'class' ]
37
- } ) , expected ) ;
38
+ t . is (
39
+ processing ( fixtures , {
40
+ prefix : 'test-' ,
41
+ filter : [ 'class' ]
42
+ } ) ,
43
+ expected
44
+ ) ;
38
45
} ) ;
39
46
40
47
test ( 'processing options prefix, filter and attribute selector witch indentical class filter' , t => {
41
48
const expected = '.class, [type="text"], [alt*="class"] { color:red; }' ;
42
49
const fixtures = '.class, [type="text"], [alt*="class"] { color:red; }' ;
43
- t . is ( processing ( fixtures , {
44
- prefix : 'test-' ,
45
- filter : [ 'class' ]
46
- } ) , expected ) ;
50
+ t . is (
51
+ processing ( fixtures , {
52
+ prefix : 'test-' ,
53
+ filter : [ 'class' ]
54
+ } ) ,
55
+ expected
56
+ ) ;
47
57
} ) ;
48
58
49
59
test ( 'processing options filter and attribute selector' , t => {
50
60
const expected = '.class, [type="text"], [class*="lorem"] { color:red; }' ;
51
61
const fixtures = '.class, [type="text"], [class*="lorem"] { color:red; }' ;
52
- t . is ( processing ( fixtures , {
53
- filter : [ 'class' ]
54
- } ) , expected ) ;
62
+ t . is (
63
+ processing ( fixtures , {
64
+ filter : [ 'class' ]
65
+ } ) ,
66
+ expected
67
+ ) ;
55
68
} ) ;
56
69
57
70
test ( 'processing options prefix, filter, ignore and attribute selector' , t => {
58
71
const expected = '.class, [type="text"], [class*="lorem"] { color:red; }' ;
59
72
const fixtures = '.class, [type="text"], [class*="lorem"] { color:red; }' ;
60
- t . is ( processing ( fixtures , {
61
- prefix : 'test' ,
62
- filter : [ 'class' ] ,
63
- ignore : [ 'class' ]
64
- } ) , expected ) ;
73
+ t . is (
74
+ processing ( fixtures , {
75
+ prefix : 'test' ,
76
+ filter : [ 'class' ] ,
77
+ ignore : [ 'class' ]
78
+ } ) ,
79
+ expected
80
+ ) ;
65
81
} ) ;
66
82
67
83
test ( 'processing options prefix, ignore and attribute selector' , t => {
68
- const expected = '.class, [type="text"], [class*="test-lorem"] { color:red; }' ;
84
+ const expected =
85
+ '.class, [type="text"], [class*="test-lorem"] { color:red; }' ;
69
86
const fixtures = '.class, [type="text"], [class*="lorem"] { color:red; }' ;
70
- t . is ( processing ( fixtures , {
71
- prefix : 'test-' ,
72
- ignore : [ 'type' ]
73
- } ) , expected ) ;
87
+ t . is (
88
+ processing ( fixtures , {
89
+ prefix : 'test-' ,
90
+ ignore : [ 'type' ]
91
+ } ) ,
92
+ expected
93
+ ) ;
74
94
} ) ;
0 commit comments