Skip to content

Commit f27f261

Browse files
added test with snapshot, webpack and sourcemap
1 parent 0a075a6 commit f27f261

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Diff for: products/nativescript/tns.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ def prepare_ios(app_name, release=False, for_device=False, log_trace=False, veri
318318

319319
@staticmethod
320320
def build(app_name, platform, release=False, provision=Settings.IOS.PROVISIONING, for_device=False, bundle=True,
321-
aot=False, uglify=False, snapshot=False, log_trace=False, verify=True, app_data=None):
321+
aot=False, uglify=False, source_map=False, snapshot=False, log_trace=False, verify=True, app_data=None):
322322
result = Tns.exec_command(command='build', path=app_name, platform=platform, release=release,
323323
provision=provision, for_device=for_device, bundle=bundle, aot=aot, uglify=uglify,
324-
snapshot=snapshot, wait=True, log_trace=log_trace)
324+
source_map=source_map, snapshot=snapshot, wait=True, log_trace=log_trace)
325325
if verify:
326326
# Verify output
327327
assert result.exit_code == 0, 'Build failed with non zero exit code.'
@@ -344,10 +344,11 @@ def build(app_name, platform, release=False, provision=Settings.IOS.PROVISIONING
344344
return result
345345

346346
@staticmethod
347-
def build_android(app_name, release=False, bundle=True, aot=False, uglify=False, snapshot=False, log_trace=False,
348-
verify=True, app_data=None):
347+
def build_android(app_name, release=False, bundle=True, aot=False, source_map=False, uglify=False, snapshot=False,
348+
log_trace=False, verify=True, app_data=None):
349349
return Tns.build(app_name=app_name, platform=Platform.ANDROID, release=release, bundle=bundle, aot=aot,
350-
uglify=uglify, snapshot=snapshot, log_trace=log_trace, verify=verify, app_data=app_data)
350+
source_map=source_map, uglify=uglify, snapshot=snapshot, log_trace=log_trace, verify=verify,
351+
app_data=app_data)
351352

352353
@staticmethod
353354
def build_ios(app_name, release=False, provision=Settings.IOS.PROVISIONING, for_device=False,

Diff for: tests/cli/build/build_tests.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_001_build_android(self):
9393
assert result.output.count("Gradle build...") == 1, "More than 1 gradle build is triggered."
9494

9595
def test_002_build_android_release(self):
96-
Tns.build_android(self.app_name, release=True)
96+
Tns.build_android(self.app_name, release=True, source_map=True, uglify=True, aot=True)
9797

9898
# Configs are respected
9999
assert File.exists(TnsPaths.get_apk_path(self.app_name, release=True))
@@ -103,6 +103,12 @@ def test_002_build_android_release(self):
103103
run(cmd=command, cwd=Settings.TEST_RUN_HOME, wait=True)
104104
assert File.exists(os.path.join(self.app_path, 'app', 'app.tar.gz'))
105105

106+
def test_100_build_snapshot_uglify_release_aot_sourceMap(self):
107+
#https://github.com/NativeScript/nativescript-dev-webpack/issues/920
108+
result = Tns.build_android(self.app_name, release=True, aot=True, uglify=True, snapshot=True, source_map=True)
109+
assert not "ERROR in NativeScriptSnapshot. Snapshot generation failed!" in result.output
110+
assert not "Target architecture: arm64-v8a" in result.output
111+
106112
def test_301_build_project_with_space_release(self):
107113

108114
# Ensure ANDROID_KEYSTORE_PATH contain spaces (verification for CLI issue 2650)

0 commit comments

Comments
 (0)