@@ -819,7 +819,17 @@ end`,
819819 command : string ,
820820 options ?: any ,
821821 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+ } ;
823833 childProcess . spawnFromEvent = async (
824834 command : string ,
825835 args : string [ ] ,
@@ -839,9 +849,8 @@ end`,
839849 } `, async ( ) => {
840850 const config = testInjector . resolve < IConfiguration > ( "config" ) ;
841851 config . USE_POD_SANDBOX = podExecutable === "sandbox-pod" ;
842- const childProcess = testInjector . resolve < IChildProcess > (
843- "childProcess"
844- ) ;
852+ const childProcess =
853+ testInjector . resolve < IChildProcess > ( "childProcess" ) ;
845854 let commandCalled = "" ;
846855 childProcess . spawnFromEvent = async (
847856 command : string ,
@@ -949,9 +958,10 @@ end`,
949958 projectPodfileContent = "" ;
950959 } ) ;
951960
952- function setupMocks (
953- pods : any [ ]
954- ) : { projectData : IProjectData ; platformData : any } {
961+ function setupMocks ( pods : any [ ] ) : {
962+ projectData : IProjectData ;
963+ platformData : any ;
964+ } {
955965 const podsPaths = pods . map ( ( p ) => p . path ) ;
956966 const projectData = testInjector . resolve ( "projectData" ) ;
957967 projectData . getAppResourcesDirectoryPath = ( ) =>
@@ -990,13 +1000,11 @@ end`,
9901000
9911001 const testCasesWithApplyAndRemove = [
9921002 {
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" ,
9951004 pods : [
9961005 {
9971006 name : "mySecondPluginWithPlatform" ,
998- path :
999- "node_modules/ mypath with spaces/mySecondPluginWithPlatform/Podfile" ,
1007+ path : "node_modules/ mypath with spaces/mySecondPluginWithPlatform/Podfile" ,
10001008 content : `platform :ios, '10.0'` ,
10011009 } ,
10021010 {
@@ -1180,8 +1188,7 @@ pod 'myPod' ~> 0.3.4
11801188end` ,
11811189 } ,
11821190 {
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" ,
11851192 pods : [
11861193 {
11871194 name : "pluginWithPlatform" ,
@@ -1220,8 +1227,7 @@ pod 'myPod' ~> 0.3.4
12201227end` ,
12211228 } ,
12221229 {
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" ,
12251231 pods : [
12261232 {
12271233 name : "myPluginWithoutPlatform" ,
@@ -1260,8 +1266,7 @@ platform :ios
12601266end` ,
12611267 } ,
12621268 {
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" ,
12651270 pods : [
12661271 {
12671272 name : "myPluginWithoutPlatform" ,
@@ -1300,13 +1305,11 @@ platform :ios
13001305end` ,
13011306 } ,
13021307 {
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" ,
13051309 pods : [
13061310 {
13071311 name : "mySecondPluginWithPlatform" ,
1308- path :
1309- "node_modules/ mypath with spaces/mySecondPluginWithPlatform/Podfile" ,
1312+ path : "node_modules/ mypath with spaces/mySecondPluginWithPlatform/Podfile" ,
13101313 content : `platform :ios, '10.0'` ,
13111314 } ,
13121315 {
0 commit comments