@@ -117,21 +117,30 @@ d::first-letter {}`
117117 expect ( actual ) . toEqual ( expected )
118118} )
119119
120- test ( 'formats selectors with Nth' , ( ) => {
121- let fixtures = [
122- [ `li:nth-child(3n-2) {}` , `li:nth-child(3n -2) {}` ] ,
123- [ `li:nth-child(0n+1) {}` , `li:nth-child(0n + 1) {}` ] ,
124- [ `li:nth-child(even of .noted) {}` , `li:nth-child(even of .noted) {}` ] ,
125- [ `li:nth-child(2n of .noted) {}` , `li:nth-child(2n of .noted) {}` ] ,
126- [ `li:nth-child(-n + 3 of .noted) {}` , `li:nth-child(-n + 3 of .noted) {}` ] ,
127- [ `li:nth-child(-n+3 of li.important) {}` , `li:nth-child(-n + 3 of li.important) {}` ] ,
128- [ `p:nth-child(n+8):nth-child(-n+15) {}` , `p:nth-child(n + 8):nth-child(-n + 15) {}` ] ,
129- ]
120+ test . each ( [
121+ [ `li:nth-child(3n-2) {}` , `li:nth-child(3n -2) {}` ] ,
122+ [ `li:nth-child(0n+1) {}` , `li:nth-child(0n + 1) {}` ] ,
123+ [ `li:nth-child(even of .noted) {}` , `li:nth-child(even of .noted) {}` ] ,
124+ [ `li:nth-child(2n of .noted) {}` , `li:nth-child(2n of .noted) {}` ] ,
125+ [ `li:nth-child(-n + 3 of .noted) {}` , `li:nth-child(-n + 3 of .noted) {}` ] ,
126+ [ `li:nth-child(-n+3 of li.important) {}` , `li:nth-child(-n + 3 of li.important) {}` ] ,
127+ [ `p:nth-child(n+8):nth-child(-n+15) {}` , `p:nth-child(n + 8):nth-child(-n + 15) {}` ] ,
128+ ] ) ( 'formats nth selector: %s' , ( css , expected ) => {
129+ let actual = format ( css )
130+ expect ( actual ) . toEqual ( expected )
131+ } )
130132
131- for ( let [ css , expected ] of fixtures ) {
132- let actual = format ( css )
133- expect ( actual ) . toEqual ( expected )
134- }
133+ test . each ( [
134+ [ `li:nth-child(3n-2) {}` , `li:nth-child(3n-2){}` ] ,
135+ [ `li:nth-child(0n+1) {}` , `li:nth-child(0n+1){}` ] ,
136+ [ `li:nth-child(even of .noted) {}` , `li:nth-child(even of .noted){}` ] ,
137+ [ `li:nth-child(2n of .noted) {}` , `li:nth-child(2n of .noted){}` ] ,
138+ [ `li:nth-child(-n + 3 of .noted) {}` , `li:nth-child(-n+3 of .noted){}` ] ,
139+ [ `li:nth-child(-n+3 of li.important) {}` , `li:nth-child(-n+3 of li.important){}` ] ,
140+ [ `p:nth-child(n+8):nth-child(-n+15) {}` , `p:nth-child(n+8):nth-child(-n+15){}` ] ,
141+ ] ) ( 'minifies nth selector: %s' , ( css , expected ) => {
142+ let actual = format ( css , { minify : true } )
143+ expect ( actual ) . toEqual ( expected )
135144} )
136145
137146test ( 'formats multiline selectors' , ( ) => {
0 commit comments