@@ -10,6 +10,7 @@ import {
10
10
ensureFirebaseSwizzlingIsEnabled ,
11
11
appDelegateOpenUrlInsertionPointAfter ,
12
12
multiline_appDelegateOpenUrlInsertionPointAfter ,
13
+ modifyAppDelegate ,
13
14
} from '../src/ios/openUrlFix' ;
14
15
import type { ExpoConfigPluginEntry } from '../src/ios/openUrlFix' ;
15
16
@@ -188,15 +189,16 @@ describe('Config Plugin iOS Tests - openUrlFix', () => {
188
189
} ) ;
189
190
190
191
const appDelegateFixturesPatch = [
191
- 'AppDelegate_bare_sdk43.m' ,
192
- 'AppDelegate_sdk44.m' ,
193
- 'AppDelegate_sdk45.mm' ,
192
+ { fixtureName : 'AppDelegate_bare_sdk43.m' , language : 'objc' } ,
193
+ { fixtureName : 'AppDelegate_sdk44.m' , language : 'objc' } ,
194
+ { fixtureName : 'AppDelegate_sdk45.mm' , language : 'objcpp' } ,
195
+ { fixtureName : 'AppDelegate_sdk53.swift' , language : 'swift' } ,
194
196
] ;
195
- appDelegateFixturesPatch . forEach ( fixtureName => {
197
+ appDelegateFixturesPatch . forEach ( ( { fixtureName, language } ) => {
196
198
it ( `munges AppDelegate correctly - ${ fixtureName } ` , async ( ) => {
197
199
const fixturePath = path . join ( __dirname , 'fixtures' , fixtureName ) ;
198
200
const appDelegate = await fs . readFile ( fixturePath , { encoding : 'utf-8' } ) ;
199
- const result = modifyObjcAppDelegate ( appDelegate ) ;
201
+ const result = modifyAppDelegate ( appDelegate , language ) ;
200
202
expect ( result ) . toMatchSnapshot ( ) ;
201
203
} ) ;
202
204
@@ -209,7 +211,7 @@ describe('Config Plugin iOS Tests - openUrlFix', () => {
209
211
modRequest : { projectRoot : path . join ( __dirname , 'fixtures' ) } as any ,
210
212
modResults : {
211
213
path : fixturePath ,
212
- language : 'objc' ,
214
+ language : language ,
213
215
contents : appDelegate ,
214
216
} as AppDelegateProjectFile ,
215
217
modRawConfig : { name : 'TestName' , slug : 'TestSlug' } ,
@@ -226,8 +228,12 @@ describe('Config Plugin iOS Tests - openUrlFix', () => {
226
228
} ) ;
227
229
} ) ;
228
230
229
- const appDelegateFixturesNoop = [ 'AppDelegate_sdk42.m' , 'AppDelegate_fallback.m' ] ;
230
- appDelegateFixturesNoop . forEach ( fixtureName => {
231
+ const appDelegateFixturesNoop = [
232
+ { fixtureName : 'AppDelegate_sdk42.m' , language : 'objc' } ,
233
+ { fixtureName : 'AppDelegate_fallback.m' , language : 'objc' } ,
234
+ { fixtureName : 'AppDelegate_noOpenURL_sdk53.swift' , language : 'swift' } ,
235
+ ] ;
236
+ appDelegateFixturesNoop . forEach ( ( { fixtureName, language } ) => {
231
237
it ( `skips AppDelegate without openURL - ${ fixtureName } ` , async ( ) => {
232
238
const fixturePath = path . join ( __dirname , 'fixtures' , fixtureName ) ;
233
239
const appDelegate = await fs . readFile ( fixturePath , { encoding : 'utf-8' } ) ;
@@ -238,7 +244,7 @@ describe('Config Plugin iOS Tests - openUrlFix', () => {
238
244
modRequest : { projectRoot : path . join ( __dirname , 'fixtures' ) } as any ,
239
245
modResults : {
240
246
path : fixturePath ,
241
- language : 'objc' ,
247
+ language : language ,
242
248
contents : appDelegate ,
243
249
} as AppDelegateProjectFile ,
244
250
modRawConfig : { name : 'TestName' , slug : 'TestSlug' } ,
@@ -264,7 +270,7 @@ describe('Config Plugin iOS Tests - openUrlFix', () => {
264
270
modRequest : { projectRoot : path . join ( __dirname , 'fixtures' ) } as any ,
265
271
modResults : {
266
272
path : fixturePath ,
267
- language : 'objc' ,
273
+ language : language ,
268
274
contents : appDelegate ,
269
275
} as AppDelegateProjectFile ,
270
276
modRawConfig : { name : 'TestName' , slug : 'TestSlug' } ,
0 commit comments