@@ -126,36 +126,9 @@ describe('assetLoader', () => {
126
126
127
127
) ;
128
128
129
- describe ( ' on ios ', ( ) => {
129
+ describe . each ( [ 'ios' , 'android' ] ) ( ' on %s ', ( platform ) => {
130
130
it ( 'should load and extract asset without scales' , async ( ) => {
131
- const { code, volume } = await compileBundle ( 'ios' , {
132
- ...fixtures ,
133
- './index.js' : "export { default } from './__fixtures__/logo.png';" ,
134
- } ) ;
135
- const context : { Export ?: { default : Record < string , any > } } = { } ;
136
- vm . runInNewContext ( code , context ) ;
137
-
138
- expect ( context . Export ?. default ) . toMatchSnapshot ( ) ;
139
- expect ( volume . toTree ( ) ) . toMatchSnapshot ( ) ;
140
- } ) ;
141
-
142
- it ( 'should load and extract asset with scales' , async ( ) => {
143
- const { code, volume } = await compileBundle ( 'ios' , {
144
- ...fixtures ,
145
- './index.js' : "export { default } from './__fixtures__/star.png';" ,
146
- } ) ;
147
-
148
- const context : { Export ?: { default : Record < string , any > } } = { } ;
149
- vm . runInNewContext ( code , context ) ;
150
-
151
- expect ( context . Export ?. default ) . toMatchSnapshot ( ) ;
152
- expect ( volume . toTree ( ) ) . toMatchSnapshot ( ) ;
153
- } ) ;
154
- } ) ;
155
-
156
- describe ( 'on android' , ( ) => {
157
- it ( 'should load and extract asset without scales' , async ( ) => {
158
- const { code, volume } = await compileBundle ( 'android' , {
131
+ const { code, volume } = await compileBundle ( platform , {
159
132
...fixtures ,
160
133
'./index.js' : "export { default } from './__fixtures__/logo.png';" ,
161
134
} ) ;
@@ -168,7 +141,7 @@ describe('assetLoader', () => {
168
141
} ) ;
169
142
170
143
it ( 'should load and extract asset with scales' , async ( ) => {
171
- const { code, volume } = await compileBundle ( 'android' , {
144
+ const { code, volume } = await compileBundle ( platform , {
172
145
...fixtures ,
173
146
'./index.js' : "export { default } from './__fixtures__/star.png';" ,
174
147
} ) ;
0 commit comments