mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Add isIOS, isAndroid in platform, and fast ts watcher and transpiler
Image should not requestLayout when sized with 'exactly' spec Update image tests Tests will run in ios only
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import TKUnit = require("./TKUnit");
|
||||
import app = require("application");
|
||||
import { isIOS, isAndroid } from "platform";
|
||||
|
||||
// >> platform-require
|
||||
import platformModule = require("platform");
|
||||
@@ -29,3 +30,12 @@ export function snippet_print_all() {
|
||||
console.log("Screen scale: " + platformModule.screen.mainScreen.scale);
|
||||
// << platform-current
|
||||
};
|
||||
|
||||
export function testIsIOSandIsAndroid() {
|
||||
if (isIOS) {
|
||||
TKUnit.assertTrue(!!NSObject, "isIOS is true-ish but common iOS APIs are not available.");
|
||||
} else if (isAndroid) {
|
||||
TKUnit.assertTrue(!!android, "isAndroid is true but common 'android' package is not available.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user