From 0e38a4f86b17e697e3dfeaf9528af651e176ad5d Mon Sep 17 00:00:00 2001
From: Artur Yorsh <10753921+artyorsh@users.noreply.github.com>
Date: Tue, 11 Dec 2018 10:19:54 +0300
Subject: [PATCH] feat(ci): integrates coveralls (#204)
* feat(ci): coveralls integration
* docs(readme): change coveralls badge link to org repo
* fix(ci): update coveralls config
---
.coveralls.yml | 1 +
.travis.yml | 4 ++--
README.md | 13 ++++++++++++-
jest.config.js | 3 ++-
package.json | 5 +++--
5 files changed, 20 insertions(+), 6 deletions(-)
create mode 100644 .coveralls.yml
diff --git a/.coveralls.yml b/.coveralls.yml
new file mode 100644
index 000000000..ca9ce4048
--- /dev/null
+++ b/.coveralls.yml
@@ -0,0 +1 @@
+repo_token: 039agDOxoHh0NPnBO3GywRBmDejtWkJ5n
diff --git a/.travis.yml b/.travis.yml
index 593971cb2..9da1ba86d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,9 +15,9 @@ matrix:
branches:
only:
- next
-
+
install:
- npm install
script:
- - scripts/ci/travis-ci-script.sh
\ No newline at end of file
+ - scripts/ci/travis-ci-script.sh
diff --git a/README.md b/README.md
index c7116e282..3672a3b40 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# react-native-ui-kitten [![Build Status](https://travis-ci.com/akveo/react-native-ui-kitten.svg?branch=next)](https://travis-ci.com/akveo/react-native-ui-kitten) [![Dependency Status](https://david-dm.org/akveo/react-native-ui-kitten/status.svg)](https://david-dm.org/akveo/react-native-ui-kitten) [![npm](https://img.shields.io/npm/dt/react-native-ui-kitten.svg)](https://www.npmjs.com/package/react-native-ui-kitten) [![npm](https://img.shields.io/npm/l/react-native-ui-kitten.svg)]()
+# react-native-ui-kitten [![Build Status][badge-travis]][link-travis] [![Coverage Status][badge-coveralls]][link-coveralls] [![Dependency Status][badge-david]][link-david] [![npm][badge-downloads]][link-downloads] [![npm][badge-license]]()
This branch contains sources of something really awesome.
We do what we did before but in a new way.
@@ -29,3 +29,14 @@ License
Enjoy!
We're always happy to receive your feedback.
+
+[badge-travis]: https://travis-ci.com/akveo/react-native-ui-kitten.svg?branch=next
+[badge-coveralls]: https://coveralls.io/repos/github/akveo/react-native-ui-kitten/badge.svg?branch=next
+[badge-david]: https://david-dm.org/akveo/react-native-ui-kitten/status.svg
+[badge-downloads]: https://img.shields.io/npm/dt/react-native-ui-kitten.svg
+[badge-license]: https://img.shields.io/npm/l/react-native-ui-kitten.svg
+
+[link-travis]: https://travis-ci.com/akveo/react-native-ui-kitten
+[link-coveralls]: https://coveralls.io/github/akveo/react-native-ui-kitten?branch=next
+[link-david]: https://david-dm.org/akveo/react-native-ui-kitten
+[link-downloads]: https://www.npmjs.com/package/react-native-ui-kitten
diff --git a/jest.config.js b/jest.config.js
index a0e4552a3..860567227 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -15,7 +15,8 @@ module.exports = {
tsConfig: './tsconfig.jest.json',
},
},
- cacheDirectory: './dist/jest',
+ cacheDirectory: './dist/jest/cache',
+ coverageDirectory: './dist/jest/coverage',
moduleNameMapper: pathsToModuleNameMapper(jestConfig.compilerOptions.paths, {
prefix: '/',
}),
diff --git a/package.json b/package.json
index 51498840c..4356e008e 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
"lint:fix": "npm run lint:src-fix && npm run lint:pg-fix",
"ci:lint": "npm run lint",
"ci:build": "npm run build:pg",
- "ci:test": "npm test",
+ "ci:test": "npm test -- --coverage && cat ./dist/jest/coverage/lcov.info | coveralls",
"test": "jest"
},
"devDependencies": {
@@ -36,11 +36,12 @@
"@types/react-test-renderer": "^16.0.3",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
+ "coveralls": "^3.0.2",
"husky": "^1.1.2",
"jest": "^23.6.0",
"metro-react-native-babel-preset": "^0.49.0",
- "react-addons-test-utils": "^15.6.2",
"react": "^16.6.0",
+ "react-addons-test-utils": "^15.6.2",
"react-native": "^0.57.4",
"react-native-mock": "^0.3.1",
"react-native-testing-library": "^1.3.0",