Skip to content

Commit df69c98

Browse files
committed
include and report test coverage information
1 parent c7073d7 commit df69c98

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ node_js:
66
before_install:
77
- curl -o- -L https://yarnpkg.com/install.sh | bash
88

9+
script:
10+
- yarn coverage
11+
912
cache:
1013
yarn: true

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
[![NPM](https://img.shields.io/npm/v/react-message-source.svg)](https://www.npmjs.com/package/react-message-source)
66
[![Build Status](https://travis-ci.org/netceteragroup/react-message-source.svg?branch=master)](https://travis-ci.org/netceteragroup/react-message-source)
7+
[![Coverage Status](https://coveralls.io/repos/github/netceteragroup/react-message-source/badge.svg?branch=master)](https://coveralls.io/github/netceteragroup/react-message-source?branch=master)
78

89
# Install
910

@@ -170,12 +171,12 @@ export default withMessages(MyComponent)
170171
```jsx
171172
function MyComponentWithNamedParams(props) {
172173
const { getMessageWithNamedParams } = props;
173-
174+
174175
// 'app.screen.userProfile' prefix is implicit here
175176
const greeting = getMessageWithNamedParams('greeting.parameterized', {
176177
userName: 'John Doe',
177178
})
178-
179+
179180
return <span>{greeting}</span>
180181
}
181182

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"scripts": {
2323
"test": "cross-env CI=1 react-scripts test --env=jsdom",
2424
"test:watch": "react-scripts test --env=jsdom",
25+
"coverage": "cross-env CI=1 react-scripts test --coverage --coverageReporters=text-lcov | coveralls",
2526
"build": "rollup -c",
2627
"start": "rollup -c -w",
2728
"prepare": "yarn run build",
@@ -40,6 +41,7 @@
4041
"@babel/plugin-proposal-class-properties": "^7.3.0",
4142
"@babel/preset-env": "^7.3.1",
4243
"@babel/preset-react": "^7.0.0",
44+
"coveralls": "^3.0.3",
4345
"cross-env": "^5.2.0",
4446
"eslint-config-airbnb": "^17.1.0",
4547
"eslint-config-prettier": "^4.0.0",

yarn.lock

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2486,6 +2486,18 @@ cosmiconfig@^5.0.0, cosmiconfig@^5.0.5, cosmiconfig@^5.0.7:
24862486
js-yaml "^3.9.0"
24872487
parse-json "^4.0.0"
24882488

2489+
coveralls@^3.0.3:
2490+
version "3.0.3"
2491+
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.3.tgz#83b1c64aea1c6afa69beaf50b55ac1bc4d13e2b8"
2492+
integrity sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg==
2493+
dependencies:
2494+
growl "~> 1.10.0"
2495+
js-yaml "^3.11.0"
2496+
lcov-parse "^0.0.10"
2497+
log-driver "^1.2.7"
2498+
minimist "^1.2.0"
2499+
request "^2.86.0"
2500+
24892501
create-ecdh@^4.0.0:
24902502
version "4.0.3"
24912503
resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff"
@@ -4265,6 +4277,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6
42654277
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
42664278
integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
42674279

4280+
"growl@~> 1.10.0":
4281+
version "1.10.5"
4282+
resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e"
4283+
integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==
4284+
42684285
growly@^1.3.0:
42694286
version "1.3.0"
42704287
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
@@ -5620,6 +5637,14 @@ js-tokens@^3.0.2:
56205637
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
56215638
integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls=
56225639

5640+
js-yaml@^3.11.0:
5641+
version "3.12.2"
5642+
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.2.tgz#ef1d067c5a9d9cb65bd72f285b5d8105c77f14fc"
5643+
integrity sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==
5644+
dependencies:
5645+
argparse "^1.0.7"
5646+
esprima "^4.0.0"
5647+
56235648
js-yaml@^3.12.0, js-yaml@^3.7.0, js-yaml@^3.9.0:
56245649
version "3.12.1"
56255650
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600"
@@ -5838,6 +5863,11 @@ lcid@^2.0.0:
58385863
dependencies:
58395864
invert-kv "^2.0.0"
58405865

5866+
lcov-parse@^0.0.10:
5867+
version "0.0.10"
5868+
resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3"
5869+
integrity sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=
5870+
58415871
left-pad@^1.3.0:
58425872
version "1.3.0"
58435873
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
@@ -5965,6 +5995,11 @@ lodash.uniq@^4.5.0:
59655995
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
59665996
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
59675997

5998+
log-driver@^1.2.7:
5999+
version "1.2.7"
6000+
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8"
6001+
integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==
6002+
59686003
loglevel@^1.4.1:
59696004
version "1.6.1"
59706005
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa"
@@ -8375,7 +8410,7 @@ request-promise-native@^1.0.5:
83758410
stealthy-require "^1.1.0"
83768411
tough-cookie ">=2.3.3"
83778412

8378-
request@^2.87.0:
8413+
request@^2.86.0, request@^2.87.0:
83798414
version "2.88.0"
83808415
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
83818416
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==

0 commit comments

Comments
 (0)