Skip to content

Commit a2534b1

Browse files
committed
Added codecov to build and README
1 parent 929f6f3 commit a2534b1

File tree

4 files changed

+115
-5
lines changed

4 files changed

+115
-5
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: node_js
2-
node_js:
3-
- "10"
2+
node_js: "10"
3+
cache:
4+
directories:
5+
- ~/.npm
46
script:
5-
- npm run test
7+
- npm run test:ci

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Simple component wrapper and utilities for testing React hooks.
55
---
66

77
[![Build Status](https://img.shields.io/travis/mpeyper/react-hooks-testing-library.svg?style=flat-square)](https://travis-ci.org/mpeyper/react-hooks-testing-library)
8+
[![codecov](https://img.shields.io/codecov/c/github/mpeyper/react-hooks-testing-library.svg?style=flat-square)](https://codecov.io/gh/mpeyper/react-hooks-testing-library)
89
[![version](https://img.shields.io/npm/v/react-hooks-testing-library.svg?style=flat-square)](https://www.npmjs.com/package/react-hooks-testing-library)
910
[![downloads](https://img.shields.io/npm/dm/react-hooks-testing-library.svg?style=flat-square)](http://www.npmtrends.com/react-hooks-testing-library)
1011
[![MIT License](https://img.shields.io/npm/l/react-hooks-testing-library.svg?style=flat-square)](https://github.com/mpeyper/react-hooks-testing-library/blob/master/LICENSE.md)
@@ -29,7 +30,7 @@ You don't really want to write a component solely for testing this hook and have
2930

3031
The `react-hooks-testing-library` is built on top of the wonderful [`react-testing-library`](http://npm.im/react-testing-library) to create a simple test harness for React hooks that handles running them within the body of a function component, as well as providing various useful utility functions for updating the inputs and retrieving the outputs of your amazing custom hook.
3132

32-
Using this library, you do not have to concern yourself with how to interact, construct, render or interact with the react component in order to test your hook. You can just use the hook directly and assert the results.
33+
Using this library, you do not have to concern yourself with how to construct, render or interact with the react component in order to test your hook. You can just use the hook directly and assert the results.
3334

3435
### When to use this library
3536

package-lock.json

Lines changed: 102 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"prepare": "npm run build",
2222
"build": "babel --out-dir lib src",
2323
"format": "prettier-eslint --write \"**/*.{js,json,md}\"",
24-
"test": "jest --coverage",
24+
"coverage": "codecov",
25+
"test": "jest",
26+
"test:ci": "npm run test && npm run coverage",
2527
"contributors:add": "all-contributors add"
2628
},
2729
"dependencies": {
@@ -38,6 +40,7 @@
3840
"all-contributors-cli": "^6.1.2",
3941
"babel-eslint": "^10.0.1",
4042
"babel-plugin-module-resolver": "^3.2.0",
43+
"codecov": "^3.2.0",
4144
"eslint": "^5.14.1",
4245
"eslint-config-prettier": "^4.0.0",
4346
"eslint-plugin-prettier": "^3.0.1",
@@ -57,6 +60,8 @@
5760
"react-dom": "^16.8.0"
5861
},
5962
"jest": {
63+
"collectCoverage": true,
64+
"coverageDirectory": "./coverage/",
6065
"collectCoverageFrom": [
6166
"**/src/**"
6267
],

0 commit comments

Comments
 (0)