From d07d4de651d5a468e57afd05f870631740ab8860 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Tue, 25 Aug 2020 15:14:52 -0700 Subject: [PATCH] fix: fixing tests --- apps/automated/app/xml-declaration/xml-declaration-tests.ts | 4 ++-- packages/core/ui/builder/component-builder/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/automated/app/xml-declaration/xml-declaration-tests.ts b/apps/automated/app/xml-declaration/xml-declaration-tests.ts index 63065fc1b..a2a623ea4 100644 --- a/apps/automated/app/xml-declaration/xml-declaration-tests.ts +++ b/apps/automated/app/xml-declaration/xml-declaration-tests.ts @@ -798,7 +798,7 @@ export function test_parse_template_property() { export function test_NonExistingElementError() { var basePath = 'xml-declaration/'; - var expectedErrorStart = 'Building UI from XML. @' + basePath + 'errors/non-existing-element.xml:11:5\n' + " > Module 'ui/unicorn' not found for element 'Unicorn'."; + var expectedErrorStart = 'Building UI from XML. @' + basePath + 'errors/non-existing-element.xml:11:5\n' + " > Module 'Unicorn' not found for element 'Unicorn'."; var message; try { Builder.load('xml-declaration/errors/non-existing-element.xml'); @@ -810,7 +810,7 @@ export function test_NonExistingElementError() { export function test_NonExistingElementInTemplateError() { var basePath = 'xml-declaration/'; - var expectedErrorStart = 'Building UI from XML. @' + basePath + 'errors/non-existing-element-in-template.xml:14:17\n' + " > Module 'ui/unicorn' not found for element 'Unicorn'."; + var expectedErrorStart = 'Building UI from XML. @' + basePath + 'errors/non-existing-element-in-template.xml:14:17\n' + " > Module 'Unicorn' not found for element 'Unicorn'."; var message; var page = Builder.load('xml-declaration/errors/non-existing-element-in-template.xml'); TKUnit.assert(page, 'Expected the xml to generate a page'); diff --git a/packages/core/ui/builder/component-builder/index.ts b/packages/core/ui/builder/component-builder/index.ts index d82c25988..615ee9f91 100644 --- a/packages/core/ui/builder/component-builder/index.ts +++ b/packages/core/ui/builder/component-builder/index.ts @@ -95,13 +95,13 @@ const createComponentInstance = profile('createComponentInstance', (elementName: } // Get the component type from module. - const instanceType = instanceModule[elementName] || Object; + const instanceType = instanceModule[elementName]; // Create instance of the component. instance = new instanceType(); } catch (ex) { const debug: typeof debugModule = require('../../../utils/debug'); - throw new debug.ScopeError(ex, "Module '" + resolvedModuleName + "' not found for element '" + (namespace ? namespace + ':' : '') + elementName + "'."); + throw new debug.ScopeError(ex, "Module '" + (resolvedModuleName || elementName) + "' not found for element '" + (namespace ? namespace + ':' : '') + elementName + "'."); } return { instance, instanceModule };