@@ -110,11 +110,7 @@ test('valid svgs ', function(t) {
110
110
} ) ;
111
111
}
112
112
113
- if (
114
- ! ( height === 15 ) ||
115
- ! ( width === 15 ) ||
116
- height !== width
117
- )
113
+ if ( ! ( height === 15 ) || ! ( width === 15 ) || height !== width )
118
114
errors . push ( 'invalid size' ) ;
119
115
120
116
if (
@@ -159,23 +155,53 @@ test('valid svgs with meta', async function(t) {
159
155
const fileNames = await readdir ( iconPath ) ;
160
156
161
157
fileNames
162
- . filter ( f => f . split ( '.' ) . pop ( ) . indexOf ( 'svg' ) !== - 1 )
158
+ . filter (
159
+ f =>
160
+ f
161
+ . split ( '.' )
162
+ . pop ( )
163
+ . indexOf ( 'svg' ) !== - 1
164
+ )
163
165
. forEach ( async f => {
164
166
const file = await readFile ( path . join ( iconPath , f ) , 'utf8' ) ;
165
167
const data = await pParse ( file ) ;
166
- t . equal ( data . svg . $ [ 'xmlns:m' ] , 'https://www.mapbox.com' , `xmlns:m is correct` ) ;
167
-
168
- const metadataAttributes = [ {
169
- 'm:parameters' :[
170
- { 'm:parameter' :[
171
- { '$' : { "m:name" :"background" , "m:type" :"color" , "m:value" :"#000" } } ,
172
- { '$' :{ "m:name" :"stroke" , "m:type" :"color" , "m:value" :"#fff" }
173
- } ]
174
- } ]
175
- } ]
176
-
177
- t . deepEqual ( data . svg [ 'm:metadata' ] , metadataAttributes , `metadata is correct` ) ;
178
- } ) ;
168
+ t . equal (
169
+ data . svg . $ [ 'xmlns:m' ] ,
170
+ 'https://www.mapbox.com' ,
171
+ `xmlns:m is correct`
172
+ ) ;
173
+
174
+ const metadataAttributes = [
175
+ {
176
+ 'm:parameters' : [
177
+ {
178
+ 'm:parameter' : [
179
+ {
180
+ $ : {
181
+ 'm:name' : 'background' ,
182
+ 'm:type' : 'color' ,
183
+ 'm:value' : '#000'
184
+ }
185
+ } ,
186
+ {
187
+ $ : {
188
+ 'm:name' : 'stroke' ,
189
+ 'm:type' : 'color' ,
190
+ 'm:value' : '#fff'
191
+ }
192
+ }
193
+ ]
194
+ }
195
+ ]
196
+ }
197
+ ] ;
198
+
199
+ t . deepEqual (
200
+ data . svg [ 'm:metadata' ] ,
201
+ metadataAttributes ,
202
+ `metadata is correct`
203
+ ) ;
204
+ } ) ;
179
205
180
206
t . end ( ) ;
181
207
} ) ;
0 commit comments