From 96e2d945a8041364e3057a101e4d4a8f17a0dfcb Mon Sep 17 00:00:00 2001 From: Amir Fefer Date: Mon, 17 Sep 2018 18:06:38 +0300 Subject: [PATCH] Fixes #24960 - Adds tests coverage via coveralls --- .travis.yml | 7 +++++++ package.json | 7 ++++++- travis_run_js_tests.sh | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100755 travis_run_js_tests.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..7e23648a559 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ + +language: node_js +node_js: + - '6.14' # previous LTS, currently in EPEL + - '8' # current LTS + - '10' # future LTS +script: ./travis_run_js_tests.sh \ No newline at end of file diff --git a/package.json b/package.json index b6337682c59..41206b032f3 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "build": "npm run format && npm run lint", "lint": "eslint webpack/", "lint:fix": "eslint --fix webpack/", - "lint:test": "npm run lint && npm test" + "lint:test": "npm run lint && npm test", + "coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" }, "repository": { "type": "git", @@ -33,6 +34,7 @@ "babel-preset-react": "^6.24.1", "enzyme": "^3.4.0", "enzyme-adapter-react-16": "^1.4.0", + "coveralls": "^3.0.0", "enzyme-to-json": "^3.1.2", "eslint": "^4.19.1", "eslint-config-airbnb": "^16.0.0", @@ -74,6 +76,9 @@ "seamless-immutable": "^7.1.2" }, "jest": { + "collectCoverage": true, + "collectCoverageFrom": ["webpack/**/*.js", "!webpack/**/bundle*"], + "coverageReporters": ["lcov"], "testURL": "http://localhost/", "setupFiles": [ "raf/polyfill", diff --git a/travis_run_js_tests.sh b/travis_run_js_tests.sh new file mode 100755 index 00000000000..9829a5bffe2 --- /dev/null +++ b/travis_run_js_tests.sh @@ -0,0 +1,3 @@ +set -ev + npm run test; + npm run coveralls; \ No newline at end of file