@@ -819,7 +819,17 @@ end`,
819
819
command : string ,
820
820
options ?: any ,
821
821
execOptions ?: IExecOptions
822
- ) : Promise < any > => null ;
822
+ ) : Promise < any > => {
823
+ if ( command === "arch -x86_64 pod --version" ) {
824
+ // This is the command that is used to check if cocoapods is installed under Rosetta 2
825
+ return {
826
+ stdout : "Bad CPU type in executable" ,
827
+ stderr : "" ,
828
+ exitCode : 0 ,
829
+ } ;
830
+ }
831
+ return null ;
832
+ } ;
823
833
childProcess . spawnFromEvent = async (
824
834
command : string ,
825
835
args : string [ ] ,
@@ -839,9 +849,8 @@ end`,
839
849
} `, async ( ) => {
840
850
const config = testInjector . resolve < IConfiguration > ( "config" ) ;
841
851
config . USE_POD_SANDBOX = podExecutable === "sandbox-pod" ;
842
- const childProcess = testInjector . resolve < IChildProcess > (
843
- "childProcess"
844
- ) ;
852
+ const childProcess =
853
+ testInjector . resolve < IChildProcess > ( "childProcess" ) ;
845
854
let commandCalled = "" ;
846
855
childProcess . spawnFromEvent = async (
847
856
command : string ,
@@ -949,9 +958,10 @@ end`,
949
958
projectPodfileContent = "" ;
950
959
} ) ;
951
960
952
- function setupMocks (
953
- pods : any [ ]
954
- ) : { projectData : IProjectData ; platformData : any } {
961
+ function setupMocks ( pods : any [ ] ) : {
962
+ projectData : IProjectData ;
963
+ platformData : any ;
964
+ } {
955
965
const podsPaths = pods . map ( ( p ) => p . path ) ;
956
966
const projectData = testInjector . resolve ( "projectData" ) ;
957
967
projectData . getAppResourcesDirectoryPath = ( ) =>
@@ -990,13 +1000,11 @@ end`,
990
1000
991
1001
const testCasesWithApplyAndRemove = [
992
1002
{
993
- name :
994
- "should select the podfile with highest platform after Podfile from App_Resources has been deleted" ,
1003
+ name : "should select the podfile with highest platform after Podfile from App_Resources has been deleted" ,
995
1004
pods : [
996
1005
{
997
1006
name : "mySecondPluginWithPlatform" ,
998
- path :
999
- "node_modules/ mypath with spaces/mySecondPluginWithPlatform/Podfile" ,
1007
+ path : "node_modules/ mypath with spaces/mySecondPluginWithPlatform/Podfile" ,
1000
1008
content : `platform :ios, '10.0'` ,
1001
1009
} ,
1002
1010
{
@@ -1180,8 +1188,7 @@ pod 'myPod' ~> 0.3.4
1180
1188
end` ,
1181
1189
} ,
1182
1190
{
1183
- name :
1184
- "should select the platform with highest version from plugins when no Podfile in App_Resources" ,
1191
+ name : "should select the platform with highest version from plugins when no Podfile in App_Resources" ,
1185
1192
pods : [
1186
1193
{
1187
1194
name : "pluginWithPlatform" ,
@@ -1220,8 +1227,7 @@ pod 'myPod' ~> 0.3.4
1220
1227
end` ,
1221
1228
} ,
1222
1229
{
1223
- name :
1224
- "should select the platform without version when no Podfile in App_Resources" ,
1230
+ name : "should select the platform without version when no Podfile in App_Resources" ,
1225
1231
pods : [
1226
1232
{
1227
1233
name : "myPluginWithoutPlatform" ,
@@ -1260,8 +1266,7 @@ platform :ios
1260
1266
end` ,
1261
1267
} ,
1262
1268
{
1263
- name :
1264
- "shouldn't replace the platform without version when no Podfile in App_Resources" ,
1269
+ name : "shouldn't replace the platform without version when no Podfile in App_Resources" ,
1265
1270
pods : [
1266
1271
{
1267
1272
name : "myPluginWithoutPlatform" ,
@@ -1300,13 +1305,11 @@ platform :ios
1300
1305
end` ,
1301
1306
} ,
1302
1307
{
1303
- name :
1304
- "should select platform from plugins when the podfile in App_Resources/iOS/Podfile has no platform" ,
1308
+ name : "should select platform from plugins when the podfile in App_Resources/iOS/Podfile has no platform" ,
1305
1309
pods : [
1306
1310
{
1307
1311
name : "mySecondPluginWithPlatform" ,
1308
- path :
1309
- "node_modules/ mypath with spaces/mySecondPluginWithPlatform/Podfile" ,
1312
+ path : "node_modules/ mypath with spaces/mySecondPluginWithPlatform/Podfile" ,
1310
1313
content : `platform :ios, '10.0'` ,
1311
1314
} ,
1312
1315
{
0 commit comments