File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
exports [` api should import modules 1` ] = ` "body { b : 2 ; } body { c : 3 ; } body { b : 2 ; } @media print { body { b: 2 ; }} @media print { body { d: 4 ; }} @media screen and (orientation:landscape) { body { a: 1 ; }} @media (orientation:landscape) { body { a: 1 ; }} "` ;
4
4
5
+ exports [` api should import modules when module string 1` ] = ` ".button { b : 2 ; } "` ;
6
+
7
+ exports [` api should import modules with dedupe 1` ] = ` "body { b : 1 ; } body { b : 2 ; } .button { b : 3 ; } "` ;
8
+
5
9
exports [` api should import named modules 1` ] = ` "body { b : 2 ; } body { c : 3 ; } body { b : 2 ; } @media print { body { b: 2 ; }} @media print { body { d: 4 ; }} @media screen { body { a: 1 ; }} "` ;
6
10
7
11
exports [` api should toString a single module 1` ] = ` "body { a : 1 ; } "` ;
Original file line number Diff line number Diff line change @@ -137,4 +137,29 @@ describe('api', () => {
137
137
138
138
expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
139
139
} ) ;
140
+
141
+ it ( 'should import modules with dedupe' , ( ) => {
142
+ const m = api ( ) ;
143
+
144
+ const m1 = [ './module1' , 'body { b: 1; }' , '' ] ;
145
+ const m2 = [ './module2' , 'body { b: 2; }' , '' ] ;
146
+ const m3 = [ './module3' , '.button { b: 3; }' , '' ] ;
147
+
148
+ m . i ( [ m1 ] , '' , true ) ;
149
+ m . i ( [ m2 ] , '' , true ) ;
150
+ m . i ( [ m3 ] , '' , true ) ;
151
+ m . i ( [ m3 ] , '' , true ) ;
152
+ m . i ( [ m3 ] , '' , true ) ;
153
+
154
+ expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
155
+ expect ( m . length ) . toBe ( 3 ) ;
156
+ } ) ;
157
+
158
+ it ( 'should import modules when module string' , ( ) => {
159
+ const m = api ( ) ;
160
+
161
+ m . i ( '.button { b: 2; }' ) ;
162
+
163
+ expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
164
+ } ) ;
140
165
} ) ;
You can’t perform that action at this time.
0 commit comments