forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication-tests-common.ts
More file actions
33 lines (30 loc) · 1.21 KB
/
application-tests-common.ts
File metadata and controls
33 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// <snippet module="application" title="application">
// # Application
// The Application module provides abstraction over the platform-specific Application implementations.
// It is the main BCL module and is required for other BCL modules to work properly.
// The default bootstrap.js implementation for each platform loads and initializes this module.
// ``` JavaScript
import app = require("application");
// ```
// The pre-required `app` module is used throughout the following code snippets.
// </snippet>
// <snippet module="application" title="application">
// ### Checking the target platform
// Use the following code in case you need to check somewhere in your code the platform you are running against:
// ``` JavaScript
if (app.android) {
console.log("We are running on Android device!");
} else if (app.ios) {
console.log("We are running on iOS device");
}
// ```
// </snippet>
import TKUnit = require("./TKUnit");
export var testInitialized = function () {
if (android) {
// we have the android defined
TKUnit.assert(app.android, "Application module not properly intialized");
} else if (NSObject) {
TKUnit.assert(app.ios, "Application module not properly intialized");
}
}