Skip to content

Commit 517004a

Browse files
committed
Merge remote-tracking branch 'ionic-team/master'
2 parents 5aa5b69 + 8bfe80d commit 517004a

File tree

9 files changed

+64
-23
lines changed

9 files changed

+64
-23
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,27 @@ Special thanks to all of the contributors. With the exception of the Ionic team'
77

88
UPDATES:
99
--------
10-
*2017-05-28: Update to Version 3.3.0*
10+
### **2017-08-26: Update to `ionic-angular` version 3.6.0**
11+
12+
We updated the project to `ionic-angular` version `3.6.0`. Developers wishing to use this should also update Ionic CLI for a better experience. With today's update, this project is now at version `0.0.5`.
13+
14+
## **Also of note:**
15+
16+
## **Added: Fix for assets not being found by Karma**
17+
18+
Thanks to [@datencia](https://github.com/datencia) for providing an update to our Karma configuration that properly sets the Karma base path so that image assets can be found during testing. This fix should also work any JSON data files you might want to use for testing. He also provided an image and updated our sample unit test spec file that tests that the image is found.
19+
20+
## **Added: Update code to match Ionic templates**
21+
22+
Thanks (again) to [@danielsogl](https://github.com/danielsogl/) for providing a code update to the project so that our code matches code created by using the `ionic start` command. Having this code properly match is important as it provides the best practice guidance for handling application start up.
23+
24+
### *2017-05-28: Update to Version 3.3.0*
1125

1226
Thanks to [@danielsogl](https://github.com/danielsogl/) for getting us up-to-date with Ionic 3.3.0, Angular 4.1.2 and Ionic Native 3.10.2.
1327

1428
Thanks to [@johnstonbl01](https://github.com/johnstonbl01/) for adding a couple of mocks that prevent us from seeing some unnecessary warning messages.
1529

16-
*2017-05-12: Update to Version 3*
30+
### *2017-05-12: Update to Version 3*
1731

1832
We've updated this repo to use Ionic v3.2.1 and Ionic CLI v3.0.0.
1933

ionic.config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "ionic-unit-testing-example",
33
"app_id": "",
4-
"type": "ionic-angular"
4+
"type": "ionic-angular",
5+
"integrations": {}
56
}

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
"@angular/http": "4.1.3",
2424
"@angular/platform-browser": "4.1.3",
2525
"@angular/platform-browser-dynamic": "4.1.3",
26-
"@ionic-native/core": "3.13.1",
27-
"@ionic-native/splash-screen": "3.13.1",
28-
"@ionic-native/status-bar": "3.13.1",
26+
"@ionic-native/core": "3.12.1",
27+
"@ionic-native/splash-screen": "3.12.1",
28+
"@ionic-native/status-bar": "3.12.1",
2929
"@ionic/storage": "2.0.1",
30-
"ionic-angular": "3.5.0",
30+
"ionic-angular": "3.6.0",
3131
"ionicons": "3.0.0",
3232
"rxjs": "5.4.0",
3333
"sw-toolbox": "3.6.0",
3434
"zone.js": "0.8.12"
3535
},
3636
"devDependencies": {
37-
"@ionic/app-scripts": "1.3.12",
38-
"@ionic/cli-plugin-ionic-angular": "1.3.1",
37+
"@angular/cli": "1.1.2",
38+
"@ionic/app-scripts": "2.1.3",
3939
"@types/jasmine": "^2.5.41",
4040
"@types/node": "^7.0.8",
4141
"angular2-template-loader": "^0.6.2",
@@ -52,8 +52,8 @@
5252
"protractor": "^5.1.1",
5353
"ts-loader": "^2.0.3",
5454
"ts-node": "^3.0.2",
55-
"typescript": "2.3.3"
55+
"typescript": "2.3.4"
5656
},
57-
"version": "0.0.1",
57+
"version": "0.0.5",
5858
"description": "An Ionic project"
5959
}

src/app/app.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export class MyApp {
1818
pages: Array<{ title: string, component: any }>;
1919

2020
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
21-
this.initializeApp();
22-
2321
// used for an example of ngFor and navigation
2422
this.pages = [
2523
{ title: 'Page One', component: Page1 },
@@ -28,7 +26,7 @@ export class MyApp {
2826

2927
}
3028

31-
initializeApp() {
29+
ionViewDidLoad() {
3230
this.platform.ready().then(() => {
3331
// Okay, so the platform is ready and our plugins are available.
3432
// Here you can do any higher level native things you might need.

src/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
1111
<link rel="manifest" href="manifest.json">
1212
<meta name="theme-color" content="#4e8ef7">
13-
13+
1414
<!-- cordova.js required for cordova apps -->
1515
<script src="cordova.js"></script>
1616

@@ -19,7 +19,7 @@
1919
if ('serviceWorker' in navigator) {
2020
navigator.serviceWorker.register('service-worker.js')
2121
.then(() => console.log('service worker installed'))
22-
.catch(err => console.log('Error', err));
22+
.catch(err => console.error('Error', err));
2323
}
2424
</script>-->
2525

@@ -34,7 +34,11 @@
3434
<!-- The polyfills js is generated during the build process -->
3535
<script src="build/polyfills.js"></script>
3636

37-
<!-- The bundle js is generated during the build process -->
37+
<!-- The vendor js is generated during the build process
38+
It contains all of the dependencies in node_modules -->
39+
<script src="build/vendor.js"></script>
40+
41+
<!-- The main bundle js is generated during the build process -->
3842
<script src="build/main.js"></script>
3943

4044
</body>

src/pages/page1/page1.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<ion-content padding>
1111
<h3>Ionic Menu Starter</h3>
1212

13+
<img src="assets/icon/favicon.ico" alt="" />
14+
1315
<p>
1416
If you get lost, the <a href="http://ionicframework.com/docs/v2">docs</a> will show you the way.
1517
</p>

src/pages/page1/page1.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,10 @@ describe('Page1', () => {
4141
expect(h3.innerText).toMatch(/ionic/i,
4242
'<h3> should say something about "Ionic"');
4343
});
44+
45+
it('should show the favicon as <img>', () => {
46+
fixture.detectChanges();
47+
const img: HTMLImageElement = fixture.debugElement.query(By.css('img')).nativeElement;
48+
expect(img.src).toContain('assets/icon/favicon.ico');
49+
});
4450
});

test-config/karma.conf.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,30 @@ var webpackConfig = require('./webpack.test.js');
22

33
module.exports = function(config) {
44
var _config = {
5-
basePath: '',
5+
basePath: '../',
66

77
frameworks: ['jasmine'],
88

9-
files: [{
10-
pattern: './karma-test-shim.js',
11-
watched: true
12-
}],
9+
files: [
10+
{
11+
pattern: './test-config/karma-test-shim.js',
12+
watched: true
13+
},
14+
{
15+
pattern: './src/assets/**/*',
16+
watched: false,
17+
included: false,
18+
served: true,
19+
nocache: false
20+
}
21+
],
22+
23+
proxies: {
24+
'/assets/': '/base/src/assets/'
25+
},
1326

1427
preprocessors: {
15-
'./karma-test-shim.js': ['webpack', 'sourcemap']
28+
'./test-config/karma-test-shim.js': ['webpack', 'sourcemap']
1629
},
1730

1831
webpack: webpackConfig,

typings/cordova-typings.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
/// <reference path="../.vscode/typings/cordova-ionic/plugins/keyboard.d.ts"/>
3+
/// <reference path="../.vscode/typings/jquery/jquery.d.ts"/>

0 commit comments

Comments
 (0)