mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: fixing tests
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user