1
- module . exports = {
1
+ const postcssTape = require ( '../../packages/postcss-tape/dist/index.cjs' ) ;
2
+ const plugin = require ( 'postcss-custom-selectors' ) ;
3
+
4
+ postcssTape ( plugin ) ( {
2
5
'basic' : {
3
6
message : 'supports basic usage'
4
7
} ,
@@ -11,7 +14,7 @@ module.exports = {
11
14
'safety' : {
12
15
message : 'supports safe tag ordering (.foo:--h1 becomes h1.foo instead of .fooh1)'
13
16
} ,
14
- 'basic: import' : {
17
+ 'basic- import' : {
15
18
message : 'supports { importFrom: { customSelectors: { ... } } } usage' ,
16
19
options : {
17
20
importFrom : {
@@ -21,7 +24,7 @@ module.exports = {
21
24
}
22
25
}
23
26
} ,
24
- 'basic:import- fn' : {
27
+ 'basic-import: fn' : {
25
28
message : 'supports { importFrom() } usage' ,
26
29
options : {
27
30
importFrom ( ) {
@@ -32,10 +35,9 @@ module.exports = {
32
35
} ;
33
36
}
34
37
} ,
35
- expect : 'basic.import.expect.css' ,
36
- result : 'basic.import.result.css'
38
+ expect : 'basic-import.expect.css'
37
39
} ,
38
- 'basic:import- fn-promise' : {
40
+ 'basic-import: fn-promise' : {
39
41
message : 'supports { async importFrom() } usage' ,
40
42
options : {
41
43
importFrom ( ) {
@@ -48,58 +50,51 @@ module.exports = {
48
50
} ) ;
49
51
}
50
52
} ,
51
- expect : 'basic.import.expect.css' ,
52
- result : 'basic.import.result.css'
53
+ expect : 'basic-import.expect.css'
53
54
} ,
54
- 'basic:import- json' : {
55
+ 'basic-import: json' : {
55
56
message : 'supports { importFrom: "test/import-selectors.json" } usage' ,
56
57
options : {
57
58
importFrom : 'test/import-selectors.json'
58
59
} ,
59
- expect : 'basic.import.expect.css' ,
60
- result : 'basic.import.result.css'
60
+ expect : 'basic-import.expect.css'
61
61
} ,
62
- 'basic:import- js' : {
62
+ 'basic-import: js' : {
63
63
message : 'supports { importFrom: "test/import-selectors.js" } usage' ,
64
64
options : {
65
65
importFrom : 'test/import-selectors.js'
66
66
} ,
67
- expect : 'basic.import.expect.css' ,
68
- result : 'basic.import.result.css'
67
+ expect : 'basic-import.expect.css'
69
68
} ,
70
- 'basic:import- css' : {
69
+ 'basic-import: css' : {
71
70
message : 'supports { importFrom: "test/import-selectors.css" } usage' ,
72
71
options : {
73
72
importFrom : 'test/import-selectors.css'
74
73
} ,
75
- expect : 'basic.import.expect.css' ,
76
- result : 'basic.import.result.css'
74
+ expect : 'basic-import.expect.css'
77
75
} ,
78
- 'basic:import- css-from' : {
76
+ 'basic-import: css-from' : {
79
77
message : 'supports { importFrom: { from: "test/import-selectors.css" } } usage' ,
80
78
options : {
81
79
importFrom : { from : 'test/import-selectors.css' }
82
80
} ,
83
- expect : 'basic.import.expect.css' ,
84
- result : 'basic.import.result.css'
81
+ expect : 'basic-import.expect.css'
85
82
} ,
86
- 'basic:import- css-from-multiple-files' : {
83
+ 'basic-import: css-from-multiple-files' : {
87
84
message : 'supports { importFrom: ["test/empty.css", "test/import-selectors.css"] } usage' ,
88
85
options : {
89
86
importFrom : [ "test/empty.css" , "test/import-selectors.css" ]
90
87
} ,
91
- expect : 'basic.import.expect.css' ,
92
- result : 'basic.import.result.css'
88
+ expect : 'basic-import.expect.css'
93
89
} ,
94
- 'basic:import- css-from-type' : {
90
+ 'basic-import: css-from-type' : {
95
91
message : 'supports { importFrom: [ { from: "test/import-selectors.css", type: "css" } ] } usage' ,
96
92
options : {
97
- importFrom : [ { from : 'test/import-selectors.css' , type : 'css' } ]
93
+ importFrom : [ { from : 'test/import-selectors.css' , type : 'css' } ]
98
94
} ,
99
- expect : 'basic.import.expect.css' ,
100
- result : 'basic.import.result.css'
95
+ expect : 'basic-import.expect.css'
101
96
} ,
102
- 'basic:import- empty' : {
97
+ 'basic-import: empty' : {
103
98
message : 'supports { importFrom: {} } usage' ,
104
99
options : {
105
100
importFrom : { }
@@ -112,8 +107,6 @@ module.exports = {
112
107
customSelectors : null
113
108
} )
114
109
} ,
115
- expect : 'basic.expect.css' ,
116
- result : 'basic.result.css' ,
117
110
after ( ) {
118
111
if ( __exportSelectorObject . customSelectors [ ':--foo' ] !== '.foo' ) {
119
112
throw new Error ( 'The exportTo function failed' ) ;
@@ -129,8 +122,7 @@ module.exports = {
129
122
}
130
123
}
131
124
} ,
132
- expect : 'basic.expect.css' ,
133
- result : 'basic.result.css'
125
+ expect : 'basic.expect.css'
134
126
} ,
135
127
'basic:export-fn-promise' : {
136
128
message : 'supports { async exportTo() } usage' ,
@@ -145,103 +137,96 @@ module.exports = {
145
137
} ) ;
146
138
}
147
139
} ,
148
- expect : 'basic.expect.css' ,
149
- result : 'basic.result.css'
140
+ expect : 'basic.expect.css'
150
141
} ,
151
142
'basic:export-json' : {
152
143
message : 'supports { exportTo: "test/export-selectors.json" } usage' ,
153
144
options : {
154
145
exportTo : 'test/export-selectors.json'
155
146
} ,
156
- expect : 'basic.expect.css' ,
157
- result : 'basic.result.css' ,
158
147
before ( ) {
159
148
global . __exportSelectorsString = require ( 'fs' ) . readFileSync ( 'test/export-selectors.json' , 'utf8' ) ;
160
149
} ,
161
150
after ( ) {
162
151
if ( global . __exportSelectorsString !== require ( 'fs' ) . readFileSync ( 'test/export-selectors.json' , 'utf8' ) ) {
163
152
throw new Error ( 'The original file did not match the freshly exported copy' ) ;
164
153
}
165
- }
154
+ } ,
155
+ expect : 'basic.expect.css'
166
156
} ,
167
157
'basic:export-js' : {
168
158
message : 'supports { exportTo: "test/export-selectors.js" } usage' ,
169
159
options : {
170
160
exportTo : 'test/export-selectors.js'
171
161
} ,
172
- expect : 'basic.expect.css' ,
173
- result : 'basic.result.css' ,
174
162
before ( ) {
175
163
global . __exportSelectorsString = require ( 'fs' ) . readFileSync ( 'test/export-selectors.js' , 'utf8' ) ;
176
164
} ,
177
165
after ( ) {
178
166
if ( global . __exportSelectorsString !== require ( 'fs' ) . readFileSync ( 'test/export-selectors.js' , 'utf8' ) ) {
179
167
throw new Error ( 'The original file did not match the freshly exported copy' ) ;
180
168
}
181
- }
169
+ } ,
170
+ expect : 'basic.expect.css'
182
171
} ,
183
172
'basic:export-mjs' : {
184
173
message : 'supports { exportTo: "test/export-selectors.mjs" } usage' ,
185
174
options : {
186
175
exportTo : 'test/export-selectors.mjs'
187
176
} ,
188
- expect : 'basic.expect.css' ,
189
- result : 'basic.result.css' ,
190
177
before ( ) {
191
178
global . __exportSelectorsString = require ( 'fs' ) . readFileSync ( 'test/export-selectors.mjs' , 'utf8' ) ;
192
179
} ,
193
180
after ( ) {
194
181
if ( global . __exportSelectorsString !== require ( 'fs' ) . readFileSync ( 'test/export-selectors.mjs' , 'utf8' ) ) {
195
182
throw new Error ( 'The original file did not match the freshly exported copy' ) ;
196
183
}
197
- }
184
+ } ,
185
+ expect : 'basic.expect.css'
198
186
} ,
199
187
'basic:export-css' : {
200
188
message : 'supports { exportTo: "test/export-selectors.css" } usage' ,
201
189
options : {
202
190
exportTo : 'test/export-selectors.css'
203
191
} ,
204
- expect : 'basic.expect.css' ,
205
- result : 'basic.result.css' ,
206
192
before ( ) {
207
193
global . __exportSelectorsString = require ( 'fs' ) . readFileSync ( 'test/export-selectors.css' , 'utf8' ) ;
208
194
} ,
209
195
after ( ) {
210
196
if ( global . __exportSelectorsString !== require ( 'fs' ) . readFileSync ( 'test/export-selectors.css' , 'utf8' ) ) {
211
197
throw new Error ( 'The original file did not match the freshly exported copy' ) ;
212
198
}
213
- }
199
+ } ,
200
+ expect : 'basic.expect.css'
214
201
} ,
215
202
'basic:export-css-to' : {
216
203
message : 'supports { exportTo: { to: "test/export-selectors.css" } } usage' ,
217
204
options : {
218
205
exportTo : { to : 'test/export-selectors.css' }
219
206
} ,
220
- expect : 'basic.expect.css' ,
221
- result : 'basic.result.css' ,
222
207
before ( ) {
223
208
global . __exportSelectorsString = require ( 'fs' ) . readFileSync ( 'test/export-selectors.css' , 'utf8' ) ;
224
209
} ,
225
210
after ( ) {
226
211
if ( global . __exportSelectorsString !== require ( 'fs' ) . readFileSync ( 'test/export-selectors.css' , 'utf8' ) ) {
227
212
throw new Error ( 'The original file did not match the freshly exported copy' ) ;
228
213
}
229
- }
214
+ } ,
215
+ expect : 'basic.expect.css'
230
216
} ,
231
217
'basic:export-css-to-type' : {
232
218
message : 'supports { exportTo: { to: "test/export-selectors.css", type: "css" } } usage' ,
233
219
options : {
234
220
exportTo : { to : 'test/export-selectors.css' , type : 'css' }
235
221
} ,
236
- expect : 'basic.expect.css' ,
237
- result : 'basic.result.css' ,
238
222
before ( ) {
239
223
global . __exportSelectorsString = require ( 'fs' ) . readFileSync ( 'test/export-selectors.css' , 'utf8' ) ;
240
224
} ,
241
225
after ( ) {
242
226
if ( global . __exportSelectorsString !== require ( 'fs' ) . readFileSync ( 'test/export-selectors.css' , 'utf8' ) ) {
243
227
throw new Error ( 'The original file did not match the freshly exported copy' ) ;
244
228
}
245
- }
229
+ } ,
230
+ expect : 'basic.expect.css'
246
231
}
247
- } ;
232
+ } ) ;
0 commit comments