From 9bcde4d0aef2022f71b40746bf65f603b98a1a95 Mon Sep 17 00:00:00 2001 From: Hristo Deshev Date: Thu, 25 Feb 2016 17:29:55 +0200 Subject: [PATCH 1/4] The BETTER zone.js hack. Pretending we're node.js. --- src/nativescript-angular/application.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/nativescript-angular/application.ts b/src/nativescript-angular/application.ts index 7f4b48939..f375477ce 100644 --- a/src/nativescript-angular/application.ts +++ b/src/nativescript-angular/application.ts @@ -1,12 +1,15 @@ //Import globals before the zone, so the latter can patch the global functions import 'globals'; -//prevent a crash in zone patches -global.HTMLElement = function() {} -global.document = {}; +//prevent a crash in zone patches. pretend we're node.js +global.process = {}; +const oldToString = Object.prototype.toString; +Object.prototype.toString = function() { + return "[object process]"; +} import "zone.js/dist/zone.js" -global.HTMLElement = undefined; -global.document = undefined; +Object.prototype.toString = oldToString; +delete global.process; import 'reflect-metadata'; import './polyfills/array'; From 0f472fcb2e9a3ebfc53edcdffec183f8c3342f15 Mon Sep 17 00:00:00 2001 From: Hristo Deshev Date: Thu, 25 Feb 2016 17:30:20 +0200 Subject: [PATCH 2/4] Change karma reporter and increase test timeout (Travis needs it) --- tests/karma.conf.js | 3 ++- tests/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/karma.conf.js b/tests/karma.conf.js index 3855ebb76..2efcf4c2a 100644 --- a/tests/karma.conf.js +++ b/tests/karma.conf.js @@ -1,5 +1,6 @@ module.exports = function(config) { config.set({ + //browserNoActivityTimeout: 40000, // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', @@ -30,7 +31,7 @@ module.exports = function(config) { // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], + reporters: ['mocha'], // web server port diff --git a/tests/package.json b/tests/package.json index 060b324fe..ad45a13ca 100644 --- a/tests/package.json +++ b/tests/package.json @@ -45,6 +45,7 @@ "karma-mocha": "^0.2.1", "karma-nativescript-launcher": "^0.3.1", "mocha": "^2.4.5", + "karma-mocha-reporter": "^1.2.0", "nativescript-dev-typescript": "^0.3.1", "shelljs": "^0.5.3", "typescript": "1.8.2" From bf6665e96f9d054ebcc7700d9d2bea43add60631 Mon Sep 17 00:00:00 2001 From: Hristo Deshev Date: Thu, 25 Feb 2016 17:32:12 +0200 Subject: [PATCH 3/4] Change the bootstrap test to return a promise. --- tests/app/tests/bootstrap.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/app/tests/bootstrap.ts b/tests/app/tests/bootstrap.ts index 48bf4dcf2..fcfc32f91 100644 --- a/tests/app/tests/bootstrap.ts +++ b/tests/app/tests/bootstrap.ts @@ -14,10 +14,9 @@ export class SimpleApp { } describe('bootstrap', () => { - it('SimpleApp bootstrapped', (done) => { + it('SimpleApp bootstrapped', () => { return bootstrap(SimpleApp).then((componentRef) => { assert.isTrue(SimpleApp === componentRef.componentType); - done(); }); }); }); From 13e48921225a863796aff4d5cf4b3cebe9272108 Mon Sep 17 00:00:00 2001 From: Hristo Deshev Date: Thu, 25 Feb 2016 17:37:14 +0200 Subject: [PATCH 4/4] Bump version to 0.0.35 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6106e20b..4394edd95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-angular", - "version": "0.0.34", + "version": "0.0.35", "description": "", "homepage": "http://www.telerik.com", "bugs": "http://www.telerik.com",