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; } }