diff --git a/.circleci/config.yml b/.circleci/config.yml index 61c5c89..e29eb14 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,9 @@ # # Check https://circleci.com/docs/2.0/language-javascript/ for more details # -version: 2 +version: 2.1 +orbs: + codecov: codecov/codecov@1.0.5 jobs: build: docker: @@ -33,5 +35,10 @@ jobs: - node_modules key: v1-dependencies-{{ checksum "package.json" }} + - run: yarn run check + # run tests! - run: yarn test + + - codecov/upload: + file: ./coverage/lcov.info diff --git a/.gitignore b/.gitignore index 726fdd8..29858ac 100755 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,6 @@ lib/ # Type coverage .type-coverage/ + +# Tests coverage +coverage/ diff --git a/README.md b/README.md index a04c88f..eb90c5f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # React Native Flyer UI [![CircleCI](https://circleci.com/gh/flyerhq/react-native-flyer-ui.svg?style=shield)](https://circleci.com/gh/flyerhq/react-native-flyer-ui) -[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fflyerhq%2Freact-native-flyer-ui%2Fdevelop%2Fpackage.json)](https://github.com/plantain-00/type-coverage) +[![codecov](https://codecov.io/gh/flyerhq/react-native-flyer-ui/branch/develop/graph/badge.svg)](https://codecov.io/gh/flyerhq/react-native-flyer-ui) +[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fflyerhq%2Freact-native-flyer-ui%2Fdevelop%2Fpackage.json)](https://github.com/plantain-00/type-coverage) diff --git a/package.json b/package.json index bb2e766..088608f 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,22 @@ "jsx", "json", "node" - ] + ], + "collectCoverage": true, + "collectCoverageFrom": [ + "src/**/*.{ts,tsx}", + "!**/index.{ts,tsx}", + "!**/styles.{ts,tsx}", + "!**/*.d.ts" + ], + "coverageThreshold": { + "global": { + "branches": 100, + "functions": 100, + "lines": 100, + "statements": 100 + } + } }, "typeCoverage": { "atLeast": 100