Skip to content

Commit d71c923

Browse files
programmer4webplequang
authored andcommitted
Tests code coverage and code climate config v2 (#7)
* code coverage * code climate config v2 * const or let instead of var * yarn.lock updated * analysis.json updated * code coverage test reporter id * config added in travis.yml
1 parent b1daf68 commit d71c923

File tree

9 files changed

+1228
-631
lines changed

9 files changed

+1228
-631
lines changed

.codeclimate.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
version: "2"
3+
checks:
4+
argument-count:
5+
enabled: true
6+
config:
7+
threshold: 4
8+
complex-logic:
9+
enabled: true
10+
config:
11+
threshold: 4
12+
file-lines:
13+
enabled: true
14+
config:
15+
threshold: 250
16+
method-complexity:
17+
enabled: true
18+
config:
19+
threshold: 5
20+
method-count:
21+
enabled: true
22+
config:
23+
threshold: 20
24+
method-lines:
25+
enabled: true
26+
config:
27+
threshold: 30
28+
nested-control-flow:
29+
enabled: true
30+
config:
31+
threshold: 4
32+
return-statements:
33+
enabled: true
34+
config:
35+
threshold: 4
36+
similar-code:
37+
enabled: true
38+
identical-code:
39+
enabled: true
40+
41+
plugins:
42+
eslint:
43+
enabled: true
44+
channel: "eslint-4"
45+
config:
46+
sanitize_batch: false
47+
extensions:
48+
- .js
49+
- .html
50+
fixme:
51+
enabled: true

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/bower_components-1.x/*
2+
/coverage/

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
bower_components/
22
bower_components-1.x/
3+
bower-1.x.json
34
node_modules/
5+
coverage/
6+
yarn-error.log
47
debug.log
58
.eslintcache
69
.DS_Store
7-
bower-1.x.json

.travis.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
language: node_js
2-
node_js: 6
2+
node_js: "lts/*"
33
dist: trusty
44
sudo: required
5+
env:
6+
global:
7+
- CC_TEST_REPORTER_ID=a57ca5e66cf9c10852daa735ad4d4eed3dd49e61af2a44768fa73cda1736ceab
58
addons:
69
firefox: latest
710
apt:
811
sources:
9-
- google-chrome
12+
- google-chrome
1013
packages:
11-
- google-chrome-stable
14+
- google-chrome-stable
1215
cache:
1316
yarn: true
1417
directories:
15-
- node_modules
16-
- bower_components
17-
- bower_components-1.x
18-
- ".eslintcache"
19-
- "$HOME/.cache/bower"
18+
- node_modules
19+
- bower_components
20+
- bower_components-1.x
21+
- ".eslintcache"
22+
- "$HOME/.cache/bower"
2023
before_script:
21-
- yarn run lint
24+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
25+
- chmod +x ./cc-test-reporter
26+
- ./cc-test-reporter before-build
27+
- yarn run lint
2228
script:
23-
- xvfb-run yarn test
29+
- xvfb-run yarn test
30+
after_script:
31+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
2432
notifications:
2533
slack:
2634
secure: VEVQ/CF/udC/4pvKXJV68B1/BkNiFjSx5xPH1RdhpKowSusTbxDtbh7/bZu2HEOYaR5QtYZskFE84yeijz32rR8GqybNSy0iBski/7PpNIDajLDi9fHC6ijtS2jz7XWCY48BJaFb+lc9VvBiNaVmwWSvjDHUGXs+vzZg1CxbPHhK6J+JgbNl0AU6TfkVkAMPTDeZY8sKjti4FQ7qYP1Yar/bBj3Za3R1VhoKEbwN0CScN4TDr/1/pEWJYk5wM4FOLOryB3shUnAI2fQ4EgUmrSmSgEYDPlt+JDNcTG/FSe4c0PcI76bfa/PlkxrT9VG91W8f7Gaj1gKK/bPLaK1emXZX1hezn93do3ddZzxz5bGN8HHyskmxzoRTj5+POOco1xIcimU72Km/28F8DCLCjJ6X1L+k1PpDNWXZAjuKMniClsGiSBI5mstNYSxjZ6OjRHuhsuRRpmKY+0QczxpxkypHmL7MmJbU1UWCwDe5x6X+qk7UdbwC2zLGJrrJrLslfVzTSq3tMiehOLvpiCnNDMDGtew5bI0eDV894QWdoO1L66qZYhf0ZebYHOcFa+Wpq/t9J/0k8cPzn/ycBM8uoihrrxVx1scDSqpEgq/0v+Ned8VTOsL1lu9fDkQuc1RMIs77d+znHHj49Tiq/M/WT0wZthFkmYX28kdp6atJOmQ=

0 commit comments

Comments
 (0)