File tree 2 files changed +23
-0
lines changed
2 files changed +23
-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 with dedupe 1` ] = ` "@media { .button { b: 2 ; }} "` ;
6
+
5
7
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
8
7
9
exports [` api should toString a single module 1` ] = ` "body { a : 1 ; } "` ;
Original file line number Diff line number Diff line change @@ -137,4 +137,25 @@ 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
+ const m1 = api ( ) ;
144
+ const m2 = api ( ) ;
145
+
146
+ const m3 = [ './module3' , '.button { b: 2; }' , '' ] ;
147
+ const m4 = [ './module4' , 'body { b: 3; }' , '' ] ;
148
+ const m5 = [ './module5' , 'body { d: 4; }' , '' ] ;
149
+
150
+ m . i ( m1 , '' , true ) ;
151
+ m . i ( m2 , '' , true ) ;
152
+ m1 . i ( m3 , '' , true ) ;
153
+ m1 . i ( m4 , '' , true ) ;
154
+ m2 . i ( m3 , '' , true ) ;
155
+ m2 . i ( m5 , '' , true ) ;
156
+
157
+ m . push ( m1 ) ;
158
+
159
+ expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
160
+ } ) ;
140
161
} ) ;
You can’t perform that action at this time.
0 commit comments