From 94272af45b5a2b8f28a7fabcf988ee849114642e Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 19 May 2015 09:13:17 +0200 Subject: [PATCH] chore: update zone.js to 0.5.1 fix #1862 --- karma-js.conf.js | 1 + modules/angular2/src/test_lib/fake_async.ts | 7 +++---- modules/angular2/test/test_lib/fake_async_spec.ts | 12 ++++-------- npm-shrinkwrap.clean.json | 2 +- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/karma-js.conf.js b/karma-js.conf.js index 8549550b83..5fd438f3d8 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -13,6 +13,7 @@ module.exports = function(config) { // zone-microtask must be included first as it contains a Promise monkey patch 'node_modules/zone.js/dist/zone-microtask.js', 'node_modules/zone.js/dist/long-stack-trace-zone.js', + 'node_modules/zone.js/dist/jasmine-patch.js', 'node_modules/traceur/bin/traceur-runtime.js', 'node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.src.js', diff --git a/modules/angular2/src/test_lib/fake_async.ts b/modules/angular2/src/test_lib/fake_async.ts index c77766854d..2881334cdd 100644 --- a/modules/angular2/src/test_lib/fake_async.ts +++ b/modules/angular2/src/test_lib/fake_async.ts @@ -25,10 +25,9 @@ interface FakeAsyncZone extends NgZoneZone { * @returns {Function} The function wrapped to be executed in the fakeAsync zone */ export function fakeAsync(fn: Function): Function { - // TODO(vicb) re-enable once the jasmine patch from zone.js is applied - // if (global.zone._inFakeAsyncZone) { - // throw new Error('fakeAsync() calls can not be nested'); - //} + if ((global.zone)._inFakeAsyncZone) { + throw new Error('fakeAsync() calls can not be nested'); + } var fakeAsyncZone = global.zone.fork({ setTimeout: _setTimeout, diff --git a/modules/angular2/test/test_lib/fake_async_spec.ts b/modules/angular2/test/test_lib/fake_async_spec.ts index b9241594d4..a9d34ab430 100644 --- a/modules/angular2/test/test_lib/fake_async_spec.ts +++ b/modules/angular2/test/test_lib/fake_async_spec.ts @@ -37,14 +37,10 @@ export function main() { it('should work with inject()', inject([Parser], fakeAsync((parser) => { expect(parser).toBeAnInstanceOf(Parser); }))); - if (!IS_DARTIUM) { - it('should throw on nested calls', () => { - // TODO(vicb): re-enable once the jasmine patch from zone.js is applied - if (!IS_DARTIUM) return; - expect(() => { fakeAsync(() => { fakeAsync(() => null)(); })(); }) - .toThrowError('fakeAsync() calls can not be nested'); - }); - } + it('should throw on nested calls', () => { + expect(() => { fakeAsync(() => { fakeAsync(() => null)(); })(); }) + .toThrowError('fakeAsync() calls can not be nested'); + }); it('should flush microtasks before returning', () => { var thenRan = false; diff --git a/npm-shrinkwrap.clean.json b/npm-shrinkwrap.clean.json index a7e8114d1a..8a9efecf75 100644 --- a/npm-shrinkwrap.clean.json +++ b/npm-shrinkwrap.clean.json @@ -9567,7 +9567,7 @@ } }, "zone.js": { - "version": "0.5.0" + "version": "0.5.1" } }, "name": "angular", diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index da3c2a305d..d51383dc89 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -14792,9 +14792,9 @@ } }, "zone.js": { - "version": "0.5.0", - "from": "https://registry.npmjs.org/zone.js/-/zone.js-0.5.0.tgz", - "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.5.0.tgz" + "version": "0.5.1", + "from": "zone.js@0.5.1", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.5.1.tgz" } } } diff --git a/package.json b/package.json index c6faeafb32..2d366982ba 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "systemjs": "^0.9.1", "traceur": "0.0.87", "which": "~1", - "zone.js": "0.5.0" + "zone.js": "0.5.1" }, "devDependencies": { "angular": "1.3.5",