Skip to content
Snippets Groups Projects
Commit b02f1bd4 authored by Maja Wichrowska's avatar Maja Wichrowska
Browse files

Set up Istanbul for JS Code Coverage

parent d8628c63
No related branches found
No related tags found
No related merge requests found
instrumentation:
root: "."
extensions: [".js", ".jsx"]
excludes: [
"node_modules/**",
"lib/**",
"public/**",
"test/**",
"coverage/**",
]
check:
global:
statements: 89
branches: 70
lines: 91
functions: 79
......@@ -13,6 +13,9 @@ script:
- 'if [ -n "${LINT-}" ]; then npm run lint ; fi'
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
- 'if [ -n "${KARMA-}" ]; then npm run tests-karma ; fi'
- 'if [ -n "${REACT-}" ]; then npm run cover; fi'
after_success:
- 'if [ "${TRAVIS_NODE_VERSION}" = "4.2" ]; then cat ./coverage/lcov.info | ./node_modules/.bin/coveralls ; fi'
env:
global:
- REACT=0.14
......
......@@ -9,12 +9,17 @@
"build:css": "node-sass css/styles.scss lib/css/_datepicker.css",
"build:svg": "webpack",
"clean": "rimraf lib",
"cover": "npm run cover:clean && npm run cover:mocha && npm run cover:check",
"cover:clean": "rimraf coverage",
"cover:check": "babel-node ./node_modules/istanbul/lib/cli check-coverage",
"cover:mocha": "babel-node ./node_modules/istanbul/lib/cli cover node_modules/mocha/bin/_mocha -- --compilers js:babel-register,jsx:babel-register --require airbnb-js-shims --recursive ./test/_helpers test/**/*",
"lint": "eslint --ext .js,.jsx src test",
"mocha": "mocha --compilers js:babel-register,jsx:babel-register --require airbnb-js-shims --recursive ./test/_helpers",
"pretest": "npm run --silent lint",
"tests-only": "npm run mocha --silent test",
"tests-karma": "karma start",
"test": "npm run tests-only && npm run tests-karma",
"posttest": "npm run --silent cover",
"storybook": "start-storybook -p 9001 -s ./public",
"tag": "git tag v$npm_package_version",
"gh-pages:clean": "rimraf _gh-pages",
......@@ -52,6 +57,7 @@
"babel-preset-airbnb": "^2.0.0",
"babel-register": "^6.11.6",
"chai": "^3.5.0",
"coveralls": "^2.11.14",
"enzyme": "^2.4.1",
"eslint": "^3.3.1",
"eslint-config-airbnb": "^10.0.1",
......@@ -61,6 +67,7 @@
"git-directory-deploy": "^1.5.1",
"imports-loader": "^0.6.5",
"in-publish": "^2.0.0",
"istanbul": "^1.1.0-alpha.1",
"json-loader": "^0.5.4",
"karma": "^1.2.0",
"karma-chai": "^0.1.0",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment