Skip to content

Commit 60aba19

Browse files
committed
chore: add unit test for the broken case
1 parent 49463eb commit 60aba19

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/cocoapods-service.ts

+33
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,39 @@ target "projectName" do
10441044
# platform :ios, '10.0'
10451045
# End Podfile
10461046
1047+
# Begin Podfile - node_modules/myPluginWithoutPlatform/Podfile
1048+
pod 'myPod' ~> 0.3.4
1049+
# End Podfile# NativeScriptPlatformSection node_modules/myFirstPluginWithPlatform/Podfile with
1050+
platform :ios
1051+
# End NativeScriptPlatformSection
1052+
end`
1053+
},
1054+
{
1055+
name: "shouldn't replace the platform without version when no Podfile in App_Resources",
1056+
pods: [{
1057+
name: 'myPluginWithoutPlatform',
1058+
path: 'node_modules/myPluginWithoutPlatform/Podfile',
1059+
content: `pod 'myPod' ~> 0.3.4`
1060+
}, {
1061+
name: 'myFirstPluginWithPlatform',
1062+
path: 'node_modules/myFirstPluginWithPlatform/Podfile',
1063+
content: `platform :ios`
1064+
}, {
1065+
name: 'mySecondPluginWithPlatform',
1066+
path: 'node_modules/mySecondPluginWithPlatform/Podfile',
1067+
content: `platform :ios, '10.0'`
1068+
}],
1069+
expectedProjectPodfileContent: `use_frameworks!
1070+
1071+
target "projectName" do
1072+
# Begin Podfile - node_modules/mySecondPluginWithPlatform/Podfile
1073+
# platform :ios, '10.0'
1074+
# End Podfile
1075+
1076+
# Begin Podfile - node_modules/myFirstPluginWithPlatform/Podfile
1077+
# platform :ios
1078+
# End Podfile
1079+
10471080
# Begin Podfile - node_modules/myPluginWithoutPlatform/Podfile
10481081
pod 'myPod' ~> 0.3.4
10491082
# End Podfile# NativeScriptPlatformSection node_modules/myFirstPluginWithPlatform/Podfile with

0 commit comments

Comments
 (0)