Skip to content

Commit fc220f4

Browse files
authored
Merge pull request #66 from datencia/fix_404_errors
Fix 404 warnings for assets
2 parents 5aa5b69 + e6bf6ab commit fc220f4

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

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,

0 commit comments

Comments
 (0)