Skip to content

Commit 75c879b

Browse files
committed
fix: tns create tests
In tns create tests sometimes app_data is none and tests fails because of: ``` if app_data.app_type in {AppType.TS, AppType.NG, AppType.SHARED_NG}: ``` Fixed by checking typescript only if app_data is not None.
1 parent e7deb5d commit 75c879b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

products/nativescript/tns_assert.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ def created(app_name, output=None, app_data=None, path=Settings.TEST_RUN_HOME, w
5050
assert File.exists(os.path.join(app_path, 'webpack.config.js')), 'Missing webpack config.'
5151
assert File.exists(os.path.join(before_watch_hooks, 'nativescript-dev-webpack.js')), 'Hooks not installed.'
5252

53-
# Verify typescript in TS and NG apps:
54-
if app_data.app_type in {AppType.TS, AppType.NG, AppType.SHARED_NG}:
55-
assert Folder.exists(os.path.join(node_path, 'nativescript-dev-typescript')), 'TS not installed in app.'
56-
assert File.exists(os.path.join(app_path, 'tsconfig.json')), 'Missing config.'
57-
if webpack:
58-
assert File.exists(os.path.join(app_path, 'tsconfig.tns.json')), 'Missing config.'
59-
assert File.exists(os.path.join(before_watch_hooks, 'nativescript-dev-typescript.js')), \
60-
'Hooks not installed.'
61-
6253
# Assert app data
6354
if app_data is not None:
55+
# Verify typescript in TS and NG apps:
56+
if app_data.app_type in {AppType.TS, AppType.NG, AppType.SHARED_NG}:
57+
assert Folder.exists(os.path.join(node_path, 'nativescript-dev-typescript')), 'TS not installed in app.'
58+
assert File.exists(os.path.join(app_path, 'tsconfig.json')), 'Missing config.'
59+
if webpack:
60+
assert File.exists(os.path.join(app_path, 'tsconfig.tns.json')), 'Missing config.'
61+
assert File.exists(os.path.join(before_watch_hooks, 'nativescript-dev-typescript.js')), \
62+
'Hooks not installed.'
63+
6464
# Assert app id
6565
if app_data.bundle_id is not None:
6666
pass

0 commit comments

Comments
 (0)