Skip to content
This repository was archived by the owner on Jul 3, 2019. It is now read-only.

Commit 1b71e0e

Browse files
committed
coverage test
1 parent 0852bba commit 1b71e0e

File tree

5 files changed

+159
-139
lines changed

5 files changed

+159
-139
lines changed

.codeclimate.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
engines:
2+
duplication:
3+
enabled: true
4+
config:
5+
languages:
6+
- javascript
7+
- typescipt
8+
eslint:
9+
enabled: true
10+
tslint:
11+
enabled: true
12+
fixme:
13+
enabled: true
14+
ratings:
15+
paths:
16+
- 'src/**.js'
17+
exclude_paths:
18+
- dist/**/*

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ trim_trailing_whitespace = true
1111
[*.md]
1212
max_line_length = off
1313
trim_trailing_whitespace = false
14+
15+
[*.yml]
16+
indent_style = space
17+
indent_size = 4

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ node_js:
44
dist: trusty
55
sudo: false
66

7+
before_script:
8+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
9+
- chmod +x ./cc-test-reporter
10+
- ./cc-test-reporter before-build
11+
712
cache:
813
directories:
914
- node_modules
@@ -16,3 +21,6 @@ script:
1621
- npm run test:headless
1722
- npm run build
1823
- xvfb-run npm run e2e
24+
25+
after_script:
26+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

angular.json

Lines changed: 122 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,123 @@
11
{
2-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3-
"version": 1,
4-
"newProjectRoot": "projects",
5-
"projects": {
6-
"loreplotter": {
7-
"root": "",
8-
"sourceRoot": "src",
9-
"projectType": "application",
10-
"prefix": "app",
11-
"schematics": {
12-
"@schematics/angular:component": {
13-
"styleext": "scss"
14-
}
15-
},
16-
"architect": {
17-
"build": {
18-
"builder": "@angular-devkit/build-angular:browser",
19-
"options": {
20-
"outputPath": "dist/loreplotter",
21-
"index": "src/index.html",
22-
"main": "src/main.ts",
23-
"polyfills": "src/polyfills.ts",
24-
"tsConfig": "src/tsconfig.app.json",
25-
"assets": [
26-
"src/favicon.ico",
27-
"src/assets"
28-
],
29-
"styles": [
30-
"src/styles.scss"
31-
],
32-
"scripts": []
33-
},
34-
"configurations": {
35-
"production": {
36-
"fileReplacements": [
37-
{
38-
"replace": "src/environments/environment.ts",
39-
"with": "src/environments/environment.prod.ts"
40-
}
41-
],
42-
"optimization": true,
43-
"outputHashing": "all",
44-
"sourceMap": false,
45-
"extractCss": true,
46-
"namedChunks": false,
47-
"aot": true,
48-
"extractLicenses": true,
49-
"vendorChunk": false,
50-
"buildOptimizer": true,
51-
"budgets": [
52-
{
53-
"type": "initial",
54-
"maximumWarning": "2mb",
55-
"maximumError": "5mb"
56-
}
57-
]
58-
}
59-
}
60-
},
61-
"serve": {
62-
"builder": "@angular-devkit/build-angular:dev-server",
63-
"options": {
64-
"browserTarget": "loreplotter:build"
65-
},
66-
"configurations": {
67-
"production": {
68-
"browserTarget": "loreplotter:build:production"
69-
}
70-
}
71-
},
72-
"extract-i18n": {
73-
"builder": "@angular-devkit/build-angular:extract-i18n",
74-
"options": {
75-
"browserTarget": "loreplotter:build"
76-
}
77-
},
78-
"test": {
79-
"builder": "@angular-devkit/build-angular:karma",
80-
"options": {
81-
"main": "src/test.ts",
82-
"polyfills": "src/polyfills.ts",
83-
"tsConfig": "src/tsconfig.spec.json",
84-
"karmaConfig": "src/karma.conf.js",
85-
"styles": [
86-
"src/styles.scss"
87-
],
88-
"scripts": [],
89-
"assets": [
90-
"src/favicon.ico",
91-
"src/assets"
92-
]
93-
}
94-
},
95-
"lint": {
96-
"builder": "@angular-devkit/build-angular:tslint",
97-
"options": {
98-
"tsConfig": [
99-
"src/tsconfig.app.json",
100-
"src/tsconfig.spec.json"
101-
],
102-
"exclude": [
103-
"**/node_modules/**"
104-
]
105-
}
106-
}
107-
}
108-
},
109-
"loreplotter-e2e": {
110-
"root": "e2e/",
111-
"projectType": "application",
112-
"prefix": "",
113-
"architect": {
114-
"e2e": {
115-
"builder": "@angular-devkit/build-angular:protractor",
116-
"options": {
117-
"protractorConfig": "e2e/protractor.conf.js",
118-
"devServerTarget": "loreplotter:serve"
119-
},
120-
"configurations": {
121-
"production": {
122-
"devServerTarget": "loreplotter:serve:production"
123-
}
124-
}
125-
},
126-
"lint": {
127-
"builder": "@angular-devkit/build-angular:tslint",
128-
"options": {
129-
"tsConfig": "e2e/tsconfig.e2e.json",
130-
"exclude": [
131-
"**/node_modules/**"
132-
]
133-
}
134-
}
135-
}
136-
}
137-
},
138-
"defaultProject": "loreplotter"
139-
}
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"loreplotter": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"styleext": "scss"
14+
}
15+
},
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/loreplotter",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "src/tsconfig.app.json",
25+
"assets": ["src/favicon.ico", "src/assets"],
26+
"styles": ["src/styles.scss"],
27+
"scripts": []
28+
},
29+
"configurations": {
30+
"production": {
31+
"fileReplacements": [
32+
{
33+
"replace": "src/environments/environment.ts",
34+
"with": "src/environments/environment.prod.ts"
35+
}
36+
],
37+
"optimization": true,
38+
"outputHashing": "all",
39+
"sourceMap": false,
40+
"extractCss": true,
41+
"namedChunks": false,
42+
"aot": true,
43+
"extractLicenses": true,
44+
"vendorChunk": false,
45+
"buildOptimizer": true,
46+
"budgets": [
47+
{
48+
"type": "initial",
49+
"maximumWarning": "2mb",
50+
"maximumError": "5mb"
51+
}
52+
]
53+
}
54+
}
55+
},
56+
"serve": {
57+
"builder": "@angular-devkit/build-angular:dev-server",
58+
"options": {
59+
"browserTarget": "loreplotter:build"
60+
},
61+
"configurations": {
62+
"production": {
63+
"browserTarget": "loreplotter:build:production"
64+
}
65+
}
66+
},
67+
"extract-i18n": {
68+
"builder": "@angular-devkit/build-angular:extract-i18n",
69+
"options": {
70+
"browserTarget": "loreplotter:build"
71+
}
72+
},
73+
"test": {
74+
"builder": "@angular-devkit/build-angular:karma",
75+
"options": {
76+
"main": "src/test.ts",
77+
"polyfills": "src/polyfills.ts",
78+
"tsConfig": "src/tsconfig.spec.json",
79+
"karmaConfig": "src/karma.conf.js",
80+
"styles": ["src/styles.scss"],
81+
"scripts": [],
82+
"assets": ["src/favicon.ico", "src/assets"],
83+
"codeCoverage": true
84+
}
85+
},
86+
"lint": {
87+
"builder": "@angular-devkit/build-angular:tslint",
88+
"options": {
89+
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
90+
"exclude": ["**/node_modules/**"]
91+
}
92+
}
93+
}
94+
},
95+
"loreplotter-e2e": {
96+
"root": "e2e/",
97+
"projectType": "application",
98+
"prefix": "",
99+
"architect": {
100+
"e2e": {
101+
"builder": "@angular-devkit/build-angular:protractor",
102+
"options": {
103+
"protractorConfig": "e2e/protractor.conf.js",
104+
"devServerTarget": "loreplotter:serve"
105+
},
106+
"configurations": {
107+
"production": {
108+
"devServerTarget": "loreplotter:serve:production"
109+
}
110+
}
111+
},
112+
"lint": {
113+
"builder": "@angular-devkit/build-angular:tslint",
114+
"options": {
115+
"tsConfig": "e2e/tsconfig.e2e.json",
116+
"exclude": ["**/node_modules/**"]
117+
}
118+
}
119+
}
120+
}
121+
},
122+
"defaultProject": "loreplotter"
123+
}

src/karma.conf.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ module.exports = function(config) {
2020
coverageIstanbulReporter: {
2121
dir: require('path').join(__dirname, '../coverage'),
2222
reports: ['html', 'lcovonly', 'text-summary'],
23-
fixWebpackSourcePaths: true
23+
fixWebpackSourcePaths: true,
24+
thresholds: {
25+
statements: 80,
26+
lines: 80,
27+
branches: 80,
28+
functions: 80
29+
}
2430
},
2531
reporters: ['progress', 'kjhtml'],
2632
port: 9876,

0 commit comments

Comments
 (0)