Skip to content

Commit

Permalink
Merge pull request #12 from UXPin/10514-fix-coverage
Browse files Browse the repository at this point in the history
10514 fix coverage - 3
  • Loading branch information
michalstocki authored Sep 20, 2017
2 parents c9c6000 + ce0e529 commit d6c830a
Show file tree
Hide file tree
Showing 7 changed files with 416 additions and 49 deletions.
8 changes: 3 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ jobs:
command: make test-resources
- run:
name: test
command: ./node_modules/.bin/jest --testResultsProcessor="jest-junit-reporter" --coverage
environment:
TEST_REPORT_PATH: ./reports
command: make test-ci
- store_test_results:
path: ./reports
- run:
name: code-coverage
command: ./packages/uxpin-code-cli/node_modules/.bin/codecov -F unittests uxpin-code-cli
command: ./packages/uxpin-code-cli/node_modules/.bin/codecov -F unittests -F uxpin_code_cli
working_directory: ~/project/

workflows:
Expand All @@ -54,4 +52,4 @@ workflows:
- build
- uxpin-code-cli:
requires:
- build
- build
1 change: 1 addition & 0 deletions packages/uxpin-code-cli/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/src/**/*.js
/src/**/*.js.map
/test/resources/repos/
/reports/
9 changes: 8 additions & 1 deletion packages/uxpin-code-cli/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH := $(shell yarn bin):$(PATH)
SHELL := /bin/bash -o pipefail

.PHONY: build check test clean test-resources
.PHONY: build check test test-ci clean test-remap-coverage test-resources

build:
tsc
Expand All @@ -13,6 +13,10 @@ test:
make test-resources
jest

test-ci:
TEST_REPORT_PATH=./reports jest --config="jest-ci.json"
make test-remap-coverage

clean:
rm -rf ./dist/
find ./src -name "*.js" -delete
Expand All @@ -26,6 +30,9 @@ clean:
rm -rf ./.nyc_output
rm -rf ./test/resources/repos/*

test-remap-coverage:
remap-istanbul -i coverage/coverage-final.json -o coverage/clover.xml -t clover

test-resources: test/resources/repos/nordnet-ui-kit test/resources/repos/arui-feather test/resources/repos/polaris

test/resources/repos/nordnet-ui-kit:
Expand Down
14 changes: 14 additions & 0 deletions packages/uxpin-code-cli/jest-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.js"
],
"coverageReporters": [
"json"
],
"testMatch": [
"**/test/**/*.test.js"
],
"testEnvironment": "node",
"testResultsProcessor": "jest-junit-reporter"
}
8 changes: 1 addition & 7 deletions packages/uxpin-code-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
"UI components"
],
"jest": {
"coverageReporters": [
"lcov"
],
"collectCoverageFrom": [
"src/**/*.ts",
"!src/**/*.d.ts"
],
"moduleFileExtensions": [
"ts",
"js"
Expand All @@ -45,6 +38,7 @@
"jest-junit-reporter": "^1.1.0",
"nordnet-ui-kit": "https://github.com/nordnet/nordnet-ui-kit.git",
"nyc": "^11.2.1",
"remap-istanbul": "^0.9.5",
"ts-jest": "^21.0.0",
"tslint": "^5.7.0",
"tslint-config-uxpin": "latest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ function getNycOptions():string {
const coverageDir:string = getCoverageOutputDirPath();
return `--cwd="${packageRootDir}" \
--report-dir="${coverageDir}" \
--reporter=lcov \
--reporter=clover \
--extension=".ts"`;
}
Loading

0 comments on commit d6c830a

Please sign in to comment.