12
12
13
13
14
14
class PrepareiOS (unittest .TestCase ):
15
+
15
16
@classmethod
16
17
def setUpClass (cls ):
17
18
if CURRENT_OS != OSType .OSX :
@@ -28,7 +29,7 @@ def setUp(self):
28
29
Folder .cleanup ('./TNS_App' )
29
30
30
31
def tearDown (self ):
31
- pass
32
+ Folder . cleanup ( './TNS_App' )
32
33
33
34
def test_001_prepare_ios (self ):
34
35
Tns .create_app_platform_add (app_name = "TNS_App" , platform = "ios" ,
@@ -47,38 +48,19 @@ def test_001_prepare_ios(self):
47
48
assert not File .exists (
48
49
'TNS_App/platforms/ios/TNSApp/app/tns_modules/application/application.ios.js' )
49
50
50
- def test_010_prepare_ios_tns_core_modules (self ):
51
- Tns .create_app (app_name = "TNS_App" , copy_from = "data/projects/helloworld-1.2.1/app" )
52
- Tns .platform_add (platform = "ios" , path = "TNS_App" ,
53
- framework_path = IOS_RUNTIME_SYMLINK_PATH , symlink = True )
54
-
55
- # Make a change in tns-core-modules to verify they are not overwritten.
56
- File .replace ("TNS_App/node_modules/tns-core-modules/application/application-common.js" ,
57
- "(\" globals\" );" ,
58
- "(\" globals\" ); // test" )
59
-
60
- # Verify tns-core-modules are copied to the native project, not app's tns_modules.
61
- for i in range (1 , 3 ):
62
- print "prepare number: " + str (i )
63
-
64
- output = run (TNS_PATH + " prepare ios --path TNS_App" )
65
- assert "You have tns_modules dir in your app folder" in output
66
- assert "Project successfully prepared" in output
67
-
68
- output = run ("cat TNS_App/app/tns_modules/package.json" )
69
- assert "\" version\" : \" 1.2.1\" ," in output
70
-
71
- output = run ("cat TNS_App/node_modules/tns-core-modules/package.json" )
72
- assert "\" version\" : \" 1.2.1\" ," not in output
73
- output = run ("cat TNS_App/node_modules/" +
74
- "tns-core-modules/application/application-common.js" )
75
- assert "require(\" globals\" ); // test" in output
51
+ def test_010_prepare_android_ng_project (self ):
52
+ output = run (TNS_PATH + " create TNS_App --ng" )
53
+ assert "successfully created" in output
54
+ Tns .platform_add (
55
+ platform = "ios" ,
56
+ path = "TNS_App" ,
57
+ framework_path = IOS_RUNTIME_SYMLINK_PATH , symlink = True )
58
+ Tns .prepare (platform = "ios" , path = "TNS_App" )
76
59
77
- output = run ("cat TNS_App/platforms/ios/TNSApp/app/tns_modules/package.json" )
78
- assert "\" version\" : \" 1.2.1\" ," not in output
79
- output = run ("cat TNS_App/platforms/ios/" +
80
- "TNSApp/app/tns_modules/application/application-common.js" )
81
- assert "require(\" globals\" ); // test" in output
60
+ assert Folder .exists (
61
+ 'TNS_App/platforms/ios/TNSApp/app/tns_modules/angular2' )
62
+ assert Folder .exists (
63
+ 'TNS_App/platforms/ios/TNSApp/app/tns_modules/nativescript-angular' )
82
64
83
65
def test_200_prepare_additional_appresources (self ):
84
66
Tns .create_app_platform_add (app_name = "TNS_App" , platform = "ios" ,
@@ -119,6 +101,39 @@ def test_201_prepare_ios_platform_not_added(self):
119
101
assert File .exists (
120
102
'TNS_App/platforms/ios/TNSApp/app/tns_modules/application/application.js' )
121
103
104
+ def test_210_prepare_ios_tns_core_modules (self ):
105
+ Tns .create_app (app_name = "TNS_App" , copy_from = "data/projects/helloworld-1.2.1/app" )
106
+ Tns .platform_add (platform = "ios" , path = "TNS_App" ,
107
+ framework_path = IOS_RUNTIME_SYMLINK_PATH , symlink = True )
108
+
109
+ # Make a change in tns-core-modules to verify they are not overwritten.
110
+ File .replace ("TNS_App/node_modules/tns-core-modules/application/application-common.js" ,
111
+ "(\" globals\" );" ,
112
+ "(\" globals\" ); // test" )
113
+
114
+ # Verify tns-core-modules are copied to the native project, not app's tns_modules.
115
+ for i in range (1 , 3 ):
116
+ print "prepare number: " + str (i )
117
+
118
+ output = run (TNS_PATH + " prepare ios --path TNS_App" )
119
+ assert "You have tns_modules dir in your app folder" in output
120
+ assert "Project successfully prepared" in output
121
+
122
+ output = run ("cat TNS_App/app/tns_modules/package.json" )
123
+ assert "\" version\" : \" 1.2.1\" ," in output
124
+
125
+ output = run ("cat TNS_App/node_modules/tns-core-modules/package.json" )
126
+ assert "\" version\" : \" 1.2.1\" ," not in output
127
+ output = run ("cat TNS_App/node_modules/" +
128
+ "tns-core-modules/application/application-common.js" )
129
+ assert "require(\" globals\" ); // test" in output
130
+
131
+ output = run ("cat TNS_App/platforms/ios/TNSApp/app/tns_modules/package.json" )
132
+ assert "\" version\" : \" 1.2.1\" ," not in output
133
+ output = run ("cat TNS_App/platforms/ios/" +
134
+ "TNSApp/app/tns_modules/application/application-common.js" )
135
+ assert "require(\" globals\" ); // test" in output
136
+
122
137
def test_300_prepare_ios_preserve_case (self ):
123
138
Tns .create_app_platform_add (app_name = "TNS_App" , platform = "ios" ,
124
139
framework_path = IOS_RUNTIME_SYMLINK_PATH , symlink = True )
0 commit comments