10
10
11
11
12
12
class TypeScript (unittest .TestCase ):
13
+
13
14
@classmethod
14
15
def setUpClass (cls ):
15
16
Folder .cleanup ('TNS_App' )
@@ -65,6 +66,14 @@ def test_101_transpilation_typescript_prepare_debug(self):
65
66
assert File .extension_exists ("TNS_App/app" , ".map" )
66
67
assert File .extension_exists ("TNS_App/app" , ".ts" )
67
68
69
+ # Verify source map in app
70
+ output = run ("cat ./TNS_App/app/app.js" )
71
+ assert "//# sourceMappingURL=app.js.map" in output
72
+
73
+ output = run ("cat ./TNS_App/app/app.js.map" )
74
+ assert "\" file\" :\" app.js\" " in output
75
+ assert "\" sources\" :[\" app.ts\" ]" in output
76
+
68
77
assert File .extension_exists (
69
78
"TNS_App/platforms/android/src/main/assets/app" , ".js" )
70
79
assert File .extension_exists (
@@ -76,6 +85,14 @@ def test_101_transpilation_typescript_prepare_debug(self):
76
85
assert not File .extension_exists (
77
86
"TNS_App/platforms/android/src/main/assets/app/tns_modules/application" , ".ts" )
78
87
88
+ # Verify source map in native android app
89
+ output = run ("cat ./TNS_App/platforms/android/src/main/assets/app/app.js" )
90
+ assert "//# sourceMappingURL=app.js.map" in output
91
+
92
+ output = run ("cat ./TNS_App/platforms/android/src/main/assets/app/app.js.map" )
93
+ assert "\" file\" :\" app.js\" " in output
94
+ assert "\" sources\" :[\" app.ts\" ]" in output
95
+
79
96
if CURRENT_OS == OSType .OSX :
80
97
81
98
# prepare in debug => .ts should go to the platforms folder
@@ -99,6 +116,14 @@ def test_101_transpilation_typescript_prepare_debug(self):
99
116
assert not File .extension_exists (
100
117
"TNS_App/platforms/android/src/main/assets/app/tns_modules/application" , ".ts" )
101
118
119
+ # Verify source map in native iOS app
120
+ output = run ("cat ./TNS_App/platforms/ios/TNSApp/app/app.js" )
121
+ assert "//# sourceMappingURL=app.js.map" in output
122
+
123
+ output = run ("cat ./TNS_App/platforms/ios/TNSApp/app/app.js.map" )
124
+ assert "\" file\" :\" app.js\" " in output
125
+ assert "\" sources\" :[\" app.ts\" ]" in output
126
+
102
127
def test_201_transpilation_typescript_prepare_release (self ):
103
128
# prepare in release => .ts should NOT go to the platforms folder
104
129
output = Tns .prepare (path = "TNS_App" , platform = "android" , release = True )
0 commit comments