Skip to content
This repository was archived by the owner on Feb 18, 2020. It is now read-only.

Commit 69cb5a7

Browse files
committed
Merge pull request #21 from Gregcop1/hotfix/travis
fix: tests and build
2 parents 9de28fd + 16a59e8 commit 69cb5a7

20 files changed

+123
-107
lines changed

.coveralls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
service_name: travis-ci

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ install:
1313
- npm install
1414

1515
script:
16-
- ng build
17-
- ng test
16+
- ng test --watch false
1817

19-
branches:
20-
only:
21-
- master
18+
after_script:
19+
- cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Hm-admin
2+
-----------
3+
4+
[![Build Status](https://travis-ci.org/coopTilleuls/hm-admin.svg?branch=master)](https://travis-ci.org/coopTilleuls/hm-admin)
5+
[![Coverage Status](https://coveralls.io/repos/github/coopTilleuls/hm-admin/badge.svg?branch=master)](https://coveralls.io/github/coopTilleuls/hm-admin?branch=master)
6+
[![Issue Count](https://codeclimate.com/github/coopTilleuls/hm-admin/badges/issue_count.svg)](https://codeclimate.com/github/coopTilleuls/hm-admin)
7+
8+
9+

angular-cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "hm-admin"
55
},
66
"apps": [
7-
{"main": "src/main.ts", "tsconfig": "src/tsconfig.json"}
7+
{"main": "src/app/hm-admin/hm-admin.component.ts", "tsconfig": "src/tsconfig.json"}
88
],
99
"addons": [],
1010
"packages": [],

config/karma-test-shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ System.import('system-config.js').then(function() {
4848
allSpecFiles.map(function (moduleName) {
4949
return System.import(moduleName);
5050
}));
51-
}).then(__karma__.start, __karma__.error);
51+
}).then(__karma__.start, __karma__.error);

config/karma.conf.js

Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,59 @@
1-
module.exports = function (config) {
2-
config.set({
3-
basePath: '..',
4-
frameworks: ['jasmine'],
5-
plugins: [
6-
require('karma-jasmine'),
7-
require('karma-chrome-launcher')
8-
],
9-
customLaunchers: {
10-
// chrome setup for travis CI using chromium
11-
Chrome_travis_ci: {
12-
base: 'Chrome',
13-
flags: ['--no-sandbox']
14-
}
15-
},
16-
files: [
17-
{ pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false },
18-
{ pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false },
19-
{ pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false },
20-
{ pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false },
21-
{ pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false },
22-
{ pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false },
1+
var configuration = {
2+
basePath: '..',
3+
frameworks: ['jasmine'],
4+
plugins: [
5+
require('karma-jasmine'),
6+
require('karma-coverage'),
7+
require('karma-chrome-launcher'),
8+
],
9+
customLaunchers: {
10+
// chrome setup for travis CI using chromium
11+
Chrome_travis_ci: {
12+
base: 'Chrome',
13+
flags: ['--no-sandbox']
14+
}
15+
},
16+
files: [
17+
{ pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false },
18+
{ pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false },
19+
{ pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false },
20+
{ pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false },
21+
{ pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false },
22+
{ pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false },
23+
24+
{ pattern: 'config/karma-test-shim.js', included: true, watched: true },
25+
26+
// Distribution folder.
27+
{ pattern: 'dist/**/*', included: false, watched: true }
28+
],
29+
exclude: [
30+
// Vendor packages might include spec files. We don't want to use those.
31+
'dist/vendor/**/*.spec.js'
32+
],
33+
preprocessors: {
34+
'dist/app/**/!(*spec|*mock).js': ['coverage']
35+
},
36+
reporters: ['progress', 'coverage'],
37+
port: 9876,
38+
colors: true,
39+
autoWatch: true,
40+
browsers: ['Chrome'],
41+
singleRun: false,
42+
43+
coverageReporter: {
44+
type: 'lcov',
45+
dir: 'coverage/',
46+
subdir: '.',
47+
file: 'lcov.info'
48+
},
49+
};
50+
51+
if (process.env.TRAVIS) {
52+
configuration.browsers = ['Chrome_travis_ci'];
53+
}
2354

24-
{ pattern: 'config/karma-test-shim.js', included: true, watched: true },
55+
module.exports = function (config) {
56+
configuration.logLevel = config.LOG_INFO;
2557

26-
// Distribution folder.
27-
{ pattern: 'dist/**/*', included: false, watched: true }
28-
],
29-
exclude: [
30-
// Vendor packages might include spec files. We don't want to use those.
31-
'dist/vendor/**/*.spec.js'
32-
],
33-
preprocessors: {},
34-
reporters: ['progress'],
35-
port: 9876,
36-
colors: true,
37-
logLevel: config.LOG_INFO,
38-
autoWatch: true,
39-
browsers: ['Chrome'],
40-
singleRun: false
41-
});
58+
config.set(configuration);
4259
};

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
"@angular/common": "2.0.0-rc.1",
3737
"@angular/compiler": "2.0.0-rc.1",
3838
"@angular/core": "2.0.0-rc.1",
39+
"@angular/http": "2.0.0-rc.1",
3940
"@angular/platform-browser": "2.0.0-rc.1",
4041
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
4142
"@angular/router": "2.0.0-rc.1",
42-
"@angular/http": "2.0.0-rc.1",
43+
"coveralls": "^2.11.9",
4344
"es6-shim": "^0.35.0",
45+
"karma-coverage": "^1.0.0",
4446
"reflect-metadata": "0.1.3",
4547
"rxjs": "5.0.0-beta.6",
4648
"systemjs": "0.19.26",

src/exemples/admin/admin.ts renamed to src/app/exemples/admin/admin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {Component} from '@angular/core';
22
import {bootstrap} from '@angular/platform-browser-dynamic';
3-
import {HmAdminComponent} from '../../hm-admin/hm-admin.component';
43
import configuration from './configuration';
4+
import {HmAdminComponent} from '../../hm-admin/hm-admin.component';
55

66
@Component({
77
selector: 'app',
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)