From 3aa8c049299cf3fc9730ccc6a556c05a1d47abe1 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Tue, 7 Jul 2015 15:16:06 +0300 Subject: [PATCH] two more tests added --- .../xml-declaration/xml-declaration-tests.ts | 20 ++++++++++++++++++- ui/builder/builder.d.ts | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/tests/xml-declaration/xml-declaration-tests.ts b/apps/tests/xml-declaration/xml-declaration-tests.ts index 83d2ee89a..027c331e0 100644 --- a/apps/tests/xml-declaration/xml-declaration-tests.ts +++ b/apps/tests/xml-declaration/xml-declaration-tests.ts @@ -59,6 +59,24 @@ export function test_loadWithOptionsWithXML() { TKUnit.assert(v instanceof view.View, "Expected result: View; Actual result: " + v + ";"); }; +export function test_loadWithOptionsFromTNS() { + var v = builder.load({ + fileName: "ui/label", + componentName: "Label" + }); + + TKUnit.assert(v instanceof labelModule.Label, "Expected result: Label; Actual result: " + v + ";"); +}; + +export function test_loadWithOptionsFromTNSPath() { + var v = builder.load({ + fileName: "tns_modules/ui/label", + componentName: "Label" + }); + + TKUnit.assert(v instanceof labelModule.Label, "Expected result: Label; Actual result: " + v + ";"); +}; + export function test_parse_ShouldNotCrashWithoutExports() { var fileAccess = new fileSystemAccess.FileSystemAccess(); @@ -178,7 +196,7 @@ export function test_parse_ThrowErrorWhenNestingPlatforms() { } catch (ex) { e = ex; } - + TKUnit.assert(e, "Expected result: Error; Actual result: " + e); }; diff --git a/ui/builder/builder.d.ts b/ui/builder/builder.d.ts index 128ccaeed..9e91c0b77 100644 --- a/ui/builder/builder.d.ts +++ b/ui/builder/builder.d.ts @@ -9,6 +9,6 @@ declare module "ui/builder" { export interface LoadOptions { fileName: string; componentName: string; - exports: any; + exports?: any; } }