Skip to content

Commit f34736b

Browse files
committed
fixed coverage results & added codecov
1 parent 24eb8a5 commit f34736b

File tree

5 files changed

+32
-7
lines changed

5 files changed

+32
-7
lines changed

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ addons:
1616
- ubuntu-toolchain-r-test
1717
packages:
1818
- g++-4.9
19+
20+
install:
21+
- npm install
22+
- npm install -g codecov
23+
24+
script:
25+
- npm run coverage
26+
27+
after_success:
28+
- codecov

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<p align="center">
44
<a href="https://travis-ci.com/zurfyx/nyao"><img src="https://travis-ci.com/zurfyx/nyao.svg?token=kXP2msyJWy3GocoENpsq&branch=master" alt="Build Status" /></a>
55
<a href="https://dependencyci.com/github/zurfyx/nyao"><img src="https://dependencyci.com/github/zurfyx/nyao/badge" alt="Dependency Status" /></a>
6+
<a href="https://codecov.io/gh/zurfyx/nyao"><img src="https://codecov.io/gh/zurfyx/nyao/branch/master/graph/badge.svg?token=fqr6VP4POE" alt="Codecov" /></a>
7+
68
</p>
79

810
## Getting started

frontend/components/Home/tests/index.test.js frontend/components/Home/__tests__/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { shallow } from 'enzyme';
55
import Home from '../';
66

77
describe('<Home />', () => {
8-
it('should render "Hello World!"', () => {
8+
it('should render "nyao.io is a specialised chat for programmers"', () => {
99
const wrapper = shallow(<Home />);
10-
expect(wrapper.text()).contains('Hello world!');
10+
expect(wrapper.text()).contains('nyao.io is a specialised chat for programmers');
1111
});
1212
});

frontend/containers/Signin/__tests__/index.test.js

Whitespace-only changes.

package.json

+18-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"test-backend": "better-npm-run test-backend",
3131
"test-frontend": "better-npm-run test-frontend",
3232
"test-e2e": "echo \"E2E tests are coming soon...\"",
33-
"coverage": "better-npm-run coverage",
33+
"coverage": "better-npm-run coverage-backend && mv coverage/coverage.raw.json coverage/coverage.backend.raw.json && better-npm-run coverage-frontend && mv coverage/coverage.raw.json coverage/coverage.frontend.raw.json && istanbul-merge --out coverage/coverage.raw.json coverage/coverage.backend.raw.json coverage/coverage.frontend.raw.json",
3434
"lint": "eslint ."
3535
},
3636
"betterScripts": {
@@ -52,23 +52,34 @@
5252
"test-backend": {
5353
"command": "mocha --compilers js:babel-core/register \"./backend/__tests__/**/*@(.js|.jsx)\" --timeout 5000",
5454
"env": {
55+
"NODE_PATH": "./backend",
5556
"NODE_ENV": "test",
5657
"PORT": 3030
5758
}
5859
},
5960
"test-frontend": {
60-
"command": "mocha --compilers js:babel-core/register \"./frontend/__tests__/**/*@(.js|.jsx)\" --timeout 5000",
61+
"command": "mocha --webpack-config webpack.config-test.js --compilers js:babel-core/register --require ignore-styles --require ./frontend/__tests__/helper.js \"frontend/**/*.test@(.js|.jsx)\" --timeout 5000",
6162
"env": {
63+
"NODE_PATH": "./frontend",
6264
"NODE_ENV": "test",
63-
"PORT": 3030
65+
"PORT": 3000
6466
}
6567
},
66-
"coverage": {
67-
"command": "istanbul cover _mocha -- --compilers js:babel-core/register \"./@(backend|frontend)/__tests__/**/*@(.js|.jsx)\" --timeout 5000",
68+
"coverage-backend": {
69+
"command": "istanbul --include-all-sources cover _mocha -- --compilers js:babel-core/register \"./backend/__tests__/**/*@(.js|.jsx)\" --timeout 5000",
6870
"env": {
71+
"NODE_PATH": "./backend",
6972
"NODE_ENV": "test",
7073
"PORT": 3030
7174
}
75+
},
76+
"coverage-frontend": {
77+
"command": "istanbul --include-all-sources cover _mocha -- --compilers js:babel-core/register --require ignore-styles --require ./frontend/__tests__/helper.js \"frontend/**/*.test@(.js|.jsx)\" --timeout 5000",
78+
"env": {
79+
"NODE_PATH": "./frontend",
80+
"NODE_ENV": "test",
81+
"PORT": 3000
82+
}
7283
}
7384
},
7485
"dependencies": {
@@ -135,7 +146,9 @@
135146
"eslint-plugin-jsx-a11y": "^2.2.3",
136147
"eslint-plugin-react": "^6.8.0",
137148
"file-loader": "^0.9.0",
149+
"ignore-styles": "^5.0.1",
138150
"istanbul": "^1.1.0-alpha.1",
151+
"istanbul-merge": "^1.1.1",
139152
"jsdom": "^9.9.1",
140153
"mocha": "^3.2.0",
141154
"mockgoose": "^6.0.8",

0 commit comments

Comments
 (0)