Skip to content

Commit 6fd5104

Browse files
authored
Merge pull request #35 from driftyco/pr/26
Pr/26
2 parents 0c1fe7a + 13cba86 commit 6fd5104

File tree

12 files changed

+46
-50
lines changed

12 files changed

+46
-50
lines changed

ionic.config.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"name": "ionic-unit-testing-example",
33
"app_id": "",
4-
"projectTypeId": "ionic-angular",
5-
"v2": true,
6-
"typescript": true
4+
"type": "ionic-angular"
75
}

package.json

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,33 @@
1313
"e2e": "webdriver-manager update --standalone false --gecko false; protractor ./test-config/protractor.conf.js"
1414
},
1515
"dependencies": {
16-
"@angular/common": "2.4.8",
17-
"@angular/compiler": "2.4.8",
18-
"@angular/compiler-cli": "2.4.8",
19-
"@angular/core": "2.4.8",
20-
"@angular/forms": "2.4.8",
21-
"@angular/http": "2.4.8",
22-
"@angular/platform-browser": "2.4.8",
23-
"@angular/platform-browser-dynamic": "2.4.8",
24-
"@angular/platform-server": "2.4.8",
25-
"@ionic-native/core": "3.1.0",
26-
"@ionic-native/splash-screen": "3.1.0",
27-
"@ionic-native/status-bar": "3.1.0",
28-
"@ionic/storage": "2.0.0",
29-
"ionic-angular": "2.2.0",
16+
"@angular/common": "4.1.0",
17+
"@angular/compiler": "4.1.0",
18+
"@angular/compiler-cli": "4.1.0",
19+
"@angular/core": "4.1.0",
20+
"@angular/forms": "4.1.0",
21+
"@angular/http": "4.1.0",
22+
"@angular/platform-browser": "4.1.0",
23+
"@angular/platform-browser-dynamic": "4.1.0",
24+
"@ionic-native/core": "3.7.0",
25+
"@ionic-native/splash-screen": "3.7.0",
26+
"@ionic-native/status-bar": "3.7.0",
27+
"@ionic/storage": "2.0.1",
28+
"ionic-angular": "3.2.1",
3029
"ionicons": "3.0.0",
31-
"rxjs": "5.0.1",
30+
"rxjs": "5.1.1",
3231
"sw-toolbox": "3.4.0",
33-
"zone.js": "0.7.2"
32+
"zone.js": "^0.8.10"
3433
},
3534
"devDependencies": {
36-
"@ionic/app-scripts": "1.1.4",
37-
"@ionic/cli-build-ionic-angular": "0.0.3",
38-
"@ionic/cli-plugin-cordova": "0.0.9",
35+
"@ionic/app-scripts": "1.3.7",
36+
"@ionic/cli-plugin-ionic-angular": "1.0.0",
3937
"@types/jasmine": "^2.5.41",
4038
"@types/node": "^7.0.8",
4139
"angular2-template-loader": "^0.6.2",
4240
"html-loader": "^0.4.5",
4341
"jasmine": "^2.5.3",
44-
"jasmine-spec-reporter": "^3.2.0",
42+
"jasmine-spec-reporter": "^4.1.0",
4543
"karma": "^1.5.0",
4644
"karma-chrome-launcher": "^2.0.0",
4745
"karma-jasmine": "^1.1.0",
@@ -52,7 +50,7 @@
5250
"protractor": "^5.1.1",
5351
"ts-loader": "^2.0.3",
5452
"ts-node": "^3.0.2",
55-
"typescript": "2.1.6"
53+
"typescript": "2.2.1"
5654
},
5755
"version": "0.0.1",
5856
"description": "An Ionic project"

src/app/app.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ describe('MyApp Component', () => {
3030
component = fixture.componentInstance;
3131
});
3232

33-
it ('should be created', () => {
33+
it('should be created', () => {
3434
expect(component instanceof MyApp).toBe(true);
3535
});
3636

37-
it ('should have two pages', () => {
37+
it('should have two pages', () => {
3838
expect(component.pages.length).toBe(2);
3939
});
4040

src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class MyApp {
1515

1616
rootPage: any = Page1;
1717

18-
pages: Array<{title: string, component: any}>;
18+
pages: Array<{ title: string, component: any }>;
1919

2020
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
2121
this.initializeApp();

src/app/app.module.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { NgModule, ErrorHandler } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
23
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
34
import { MyApp } from './app.component';
45

@@ -15,7 +16,8 @@ import { SplashScreen } from '@ionic-native/splash-screen';
1516
Page2
1617
],
1718
imports: [
18-
IonicModule.forRoot(MyApp)
19+
BrowserModule,
20+
IonicModule.forRoot(MyApp, {}, { links: [] })
1921
],
2022
bootstrap: [IonicApp],
2123
entryComponents: [
@@ -26,7 +28,7 @@ import { SplashScreen } from '@ionic-native/splash-screen';
2628
providers: [
2729
StatusBar,
2830
SplashScreen,
29-
{provide: ErrorHandler, useClass: IonicErrorHandler}
31+
{ provide: ErrorHandler, useClass: IonicErrorHandler }
3032
]
3133
})
32-
export class AppModule {}
34+
export class AppModule { }

src/pages/page1/page1.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { Page1 } from './page1';
55
import { IonicModule, Platform, NavController } from 'ionic-angular/index';
66
import { PlatformMock } from '../../../test-config/mocks-ionic';
77

8-
describe('Page1', function () {
8+
describe('Page1', function() {
99
let de: DebugElement;
1010
let comp: Page1;
1111
let fixture: ComponentFixture<Page1>;
1212

1313
beforeEach(async(() => {
1414
TestBed.configureTestingModule({
15-
declarations: [ Page1 ],
15+
declarations: [Page1],
1616
imports: [
1717
IonicModule.forRoot(Page1)
1818
],
@@ -29,7 +29,7 @@ describe('Page1', function () {
2929
de = fixture.debugElement.query(By.css('h3'));
3030
});
3131

32-
it('should create component', () => expect(comp).toBeDefined() );
32+
it('should create component', () => expect(comp).toBeDefined());
3333

3434
it('should have expected <h3> text', () => {
3535
fixture.detectChanges();

src/pages/page1/page1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { NavController } from 'ionic-angular';
99
export class Page1 {
1010

1111
constructor(public navCtrl: NavController) {
12-
12+
1313
}
1414

1515
}

src/pages/page2/page2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<ion-content>
1111
<ion-list>
1212
<button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">
13-
<ion-icon [name]="item.icon" item-left></ion-icon>
13+
<ion-icon [name]="item.icon" item-start></ion-icon>
1414
{{item.title}}
15-
<div class="item-note" item-right>
15+
<div class="item-note" item-end>
1616
{{item.note}}
1717
</div>
1818
</button>

src/pages/page2/page2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import { NavController, NavParams } from 'ionic-angular';
99
export class Page2 {
1010
selectedItem: any;
1111
icons: string[];
12-
items: Array<{title: string, note: string, icon: string}>;
12+
items: Array<{ title: string, note: string, icon: string }>;
1313

1414
constructor(public navCtrl: NavController, public navParams: NavParams) {
1515
// If we navigated to this page, we will have an item available as a nav param
1616
this.selectedItem = navParams.get('item');
1717

1818
// Let's populate this page with some filler content for funzies
1919
this.icons = ['flask', 'wifi', 'beer', 'football', 'basketball', 'paper-plane',
20-
'american-football', 'boat', 'bluetooth', 'build'];
20+
'american-football', 'boat', 'bluetooth', 'build'];
2121

2222
this.items = [];
2323
for (let i = 1; i < 11; i++) {

test-config/karma-test-shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ appContext.keys().forEach(appContext);
1818
var testing = require('@angular/core/testing');
1919
var browser = require('@angular/platform-browser-dynamic/testing');
2020

21-
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());
21+
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());

0 commit comments

Comments
 (0)