From 2f49f966e42ce4a6d0bb551b6765eb75240abc5b Mon Sep 17 00:00:00 2001 From: Stephen Hazleton Date: Thu, 17 Nov 2016 09:18:26 +1100 Subject: [PATCH] Don't mock Ionic when configuring the testing module closes #175 --- CHANGELOG.md | 13 ++++++++++--- src/pages/clickerList/clickerList.spec.ts | 1 + src/pages/page2/page2.spec.ts | 1 + src/test.ts | 9 ++------- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91056cc..f66dc26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ + +# 2.2.1 (2016-11-17) + +### Bug Fixes + +* **Unit**: Don't mock Ionic when configuring the testing module [#175](https://github.com/lathonez/clicker/issues/175) ([](https://github.com/lathonez/clicker/commit/)) + # 2.2.0 (2016-11-07) @@ -10,14 +17,14 @@ ### Bug Fixes -* **Build**: Using environment variables for travis build directory #162 [#162](https://github.com/lathonez/clicker/issues/162) ([9f81dc4](https://github.com/lathonez/clicker/commit/9f81dc4)) +* **Build**: Using environment variables for travis build directory [#162](https://github.com/lathonez/clicker/issues/162) ([9f81dc4](https://github.com/lathonez/clicker/commit/9f81dc4)) # 2.1.1 (2016-10-31) ### Bug Fixes -* **Unit**: Windows 10 needs explicit excludes #159 [#159](https://github.com/lathonez/clicker/issues/159) ([0e55cc1](https://github.com/lathonez/clicker/commit/0e55cc1)) +* **Unit**: Windows 10 needs explicit excludes [#159](https://github.com/lathonez/clicker/issues/159) ([0e55cc1](https://github.com/lathonez/clicker/commit/0e55cc1)) # 2.1.0 (2016-10-30) @@ -32,7 +39,7 @@ ### Bug Fixes * **Unit**: Barrels aren't working with modules since latest upgrade: ([0c0993b](https://github.com/lathonez/clicker/commit/0c0993b)) -* **Unit**: Add compileComponents to beforeEach, use ng-cli's tsconfig.json for testing for #155 [#155](https://github.com/lathonez/clicker/issues/155) ([d59d968](https://github.com/lathonez/clicker/commit/d59d968)) +* **Unit**: Add compileComponents to beforeEach, use ng-cli's tsconfig.json for testing for [#155](https://github.com/lathonez/clicker/issues/155) ([d59d968](https://github.com/lathonez/clicker/commit/d59d968)) # 2.0.0 (2016-10-16) diff --git a/src/pages/clickerList/clickerList.spec.ts b/src/pages/clickerList/clickerList.spec.ts index 12f7afe..fc360f7 100644 --- a/src/pages/clickerList/clickerList.spec.ts +++ b/src/pages/clickerList/clickerList.spec.ts @@ -11,6 +11,7 @@ describe('ClickerList', () => { beforeEach(async(() => TestUtils.beforeEachCompiler([ClickerList, ClickerForm, ClickerButton]).then(compiled => { fixture = compiled.fixture; instance = compiled.instance; + fixture.detectChanges(); }))); afterEach(() => { diff --git a/src/pages/page2/page2.spec.ts b/src/pages/page2/page2.spec.ts index 32b21fa..c4fb445 100644 --- a/src/pages/page2/page2.spec.ts +++ b/src/pages/page2/page2.spec.ts @@ -10,6 +10,7 @@ describe('Pages: Page2', () => { beforeEach(async(() => TestUtils.beforeEachCompiler([Page2]).then(compiled => { fixture = compiled.fixture; instance = compiled.instance; + fixture.detectChanges(); }))); afterEach(() => { diff --git a/src/test.ts b/src/test.ts index 45da939..d12d17f 100644 --- a/src/test.ts +++ b/src/test.ts @@ -10,7 +10,7 @@ import 'zone.js/dist/fake-async-test'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { TestBed } from '@angular/core/testing'; import { App, MenuController, NavController, Platform, Config, Keyboard, Form, IonicModule } from 'ionic-angular'; -import { ConfigMock, NavMock, PlatformMock } from './mocks'; +import { ConfigMock } from './mocks'; import { ClickersServiceMock } from './services/clickers.mock'; import { ClickersService } from './services'; @@ -58,13 +58,8 @@ export class TestUtils { ...components, ], providers: [ - {provide: App, useClass: ConfigMock}, + App, Platform, Form, Keyboard, MenuController, NavController, {provide: Config, useClass: ConfigMock}, - Form, - {provide: Keyboard, useClass: ConfigMock}, - {provide: MenuController, useClass: ConfigMock}, - {provide: NavController, useClass: NavMock}, - {provide: Platform, useClass: PlatformMock}, {provide: ClickersService, useClass: ClickersServiceMock}, ], imports: [