Fix node-tests on OSX by explicitly requiring modules with relative paths.

This commit is contained in:
Hristo Deshev
2016-05-30 12:41:18 +03:00
parent b812411ce1
commit 2ebe9d681a
4 changed files with 13 additions and 10 deletions

1
node-tests/node-shims.ts Normal file
View File

@@ -0,0 +1 @@
declare var require: any;

View File

@@ -1,5 +1,6 @@
import {assert} from "chai";
import xml = require('xml');
import * as xmlModule from "xml";
var xml: typeof xmlModule = require("../tns-core-modules/xml");
describe("angular xml parser", () => {
let last_element = null;
@@ -7,7 +8,7 @@ describe("angular xml parser", () => {
let parser = null;
beforeEach(() => {
parser = new xml.XmlParser(function (event: xml.ParserEvent) {
parser = new xml.XmlParser(function (event: xmlModule.ParserEvent) {
switch (event.eventType) {
case xml.ParserEventType.StartElement:
last_element = event.elementName;

View File

@@ -1,5 +1,6 @@
import {assert} from "chai";
import xml = require('xml');
import * as xmlModule from "xml";
var xml: typeof xmlModule = require("../tns-core-modules/xml");
describe("xml parser", () => {
let last_element = null;
@@ -8,7 +9,7 @@ describe("xml parser", () => {
let parser = null;
beforeEach(() => {
parser = new xml.XmlParser(function (event: xml.ParserEvent) {
parser = new xml.XmlParser(function (event: xmlModule.ParserEvent) {
switch (event.eventType) {
case xml.ParserEventType.StartElement:
last_element = event.elementName;