From 4bfad58e6caa2bb8594f2180994c81655922bebc Mon Sep 17 00:00:00 2001 From: Ciro Nunes Date: Wed, 16 Dec 2015 11:20:07 -0200 Subject: [PATCH] chore(blueprints): remove injectAsync in favor of inject & always import useful parts of testing lib --- .../src/app/components/__name__/__name__.spec.ts | 5 ++--- .../ng2/blueprints/ng2/files/src/app/__name__.spec.ts | 11 ++++++++++- .../files/src/app/pipes/__name__/__name__.spec.ts | 1 - .../files/src/app/services/__name__/__name__.spec.ts | 1 - 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/addon/ng2/blueprints/component-test/files/src/app/components/__name__/__name__.spec.ts b/addon/ng2/blueprints/component-test/files/src/app/components/__name__/__name__.spec.ts index 7b432d5f8907..60f749d7e741 100644 --- a/addon/ng2/blueprints/component-test/files/src/app/components/__name__/__name__.spec.ts +++ b/addon/ng2/blueprints/component-test/files/src/app/components/__name__/__name__.spec.ts @@ -5,7 +5,6 @@ import { ddescribe, expect, inject, - injectAsync, TestComponentBuilder, beforeEachProviders } from 'angular2/testing'; @@ -18,8 +17,8 @@ describe('<%= classifiedModuleName %> Component', () => { beforeEachProviders(() => []); - it('should ...', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { - return tcb.createAsync(<%= classifiedModuleName %>).then((fixture) => { + it('should ...', inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { + tcb.createAsync(<%= classifiedModuleName %>).then((fixture) => { fixture.detectChanges(); }); })); diff --git a/addon/ng2/blueprints/ng2/files/src/app/__name__.spec.ts b/addon/ng2/blueprints/ng2/files/src/app/__name__.spec.ts index f118dc87b206..64e70f4c129e 100644 --- a/addon/ng2/blueprints/ng2/files/src/app/__name__.spec.ts +++ b/addon/ng2/blueprints/ng2/files/src/app/__name__.spec.ts @@ -1,4 +1,13 @@ -import {describe, it, expect, beforeEachProviders, inject} from 'angular2/testing'; +import { + it, + iit, + describe, + ddescribe, + expect, + inject, + TestComponentBuilder, + beforeEachProviders +} from 'angular2/testing'; import {<%= jsComponentName %>App} from '../app/<%= htmlComponentName %>'; beforeEachProviders(() => [<%= jsComponentName %>App]); diff --git a/addon/ng2/blueprints/pipe/files/src/app/pipes/__name__/__name__.spec.ts b/addon/ng2/blueprints/pipe/files/src/app/pipes/__name__/__name__.spec.ts index c9a8817c7830..98198ac30750 100644 --- a/addon/ng2/blueprints/pipe/files/src/app/pipes/__name__/__name__.spec.ts +++ b/addon/ng2/blueprints/pipe/files/src/app/pipes/__name__/__name__.spec.ts @@ -5,7 +5,6 @@ import { ddescribe, expect, inject, - injectAsync, TestComponentBuilder, beforeEachProviders } from 'angular2/testing'; diff --git a/addon/ng2/blueprints/service/files/src/app/services/__name__/__name__.spec.ts b/addon/ng2/blueprints/service/files/src/app/services/__name__/__name__.spec.ts index 5650fee31b81..0163672e10d0 100644 --- a/addon/ng2/blueprints/service/files/src/app/services/__name__/__name__.spec.ts +++ b/addon/ng2/blueprints/service/files/src/app/services/__name__/__name__.spec.ts @@ -5,7 +5,6 @@ import { ddescribe, expect, inject, - injectAsync, TestComponentBuilder, beforeEachProviders } from 'angular2/testing';