Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Commit

Permalink
Better test coverage (#112)
Browse files Browse the repository at this point in the history
* working on better codecoverage

* better test coverage

* possible syntax error in travis yml

* add missing nyc config
  • Loading branch information
stipsan committed Aug 1, 2016
1 parent 38944a6 commit 98862ac
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"presets" : ["es2015", "react", "stage-0"]
"presets" : ["react", "es2015", "stage-0"],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lib
node_modules
npm-debug.log
.nyc_output
coverage
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: node_js
node_js:
- "node"
script: "npm test && npm run lint"
after_script: "npm run coverage"
notifications:
email: false
env:
Expand Down
28 changes: 21 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"description": "UIkit components built with React",
"main": "./lib",
"scripts": {
"test": "mocha --compilers js:babel-register --require babel-polyfill --require ./test/.setup.js --recursive",
"test": "NODE_ENV=test mocha --colors --compilers js:babel-register --require ./test/.setup.js --require babel-polyfill --recursive",
"test:watch": "npm test -- --watch --growl",
"lint": "eslint .",
"codeclimate": "codeclimate-test-reporter < ./coverage/lcov.info",
"check-coverage": "nyc npm test && nyc check-coverage --statements 80 --branches 80 --functions 80 --lines 80 ",
"codeclimate": "codeclimate-test-reporter < coverage/lcovcoverage.lcov",
"coverage": "npm run coveralls && npm run codeclimate",
"coveralls": "node_modules/.bin/babel-node node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec --recursive test && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"coveralls": "nyc npm test && nyc report --reporter=text-lcov > coverage/lcovcoverage.lcov && cat coverage/lcovcoverage.lcov | ./node_modules/coveralls/bin/coveralls.js",
"prebuild": "rm -rf lib",
"build": "babel ./src --out-dir ./lib",
"prepublish": "npm run build",
Expand All @@ -32,18 +33,30 @@
"bugs": {
"url": "https://github.com/stipsan/uikit-react/issues"
},
"nyc": {
"include": [
"src/**.js"
],
"require": [
"babel-register"
],
"sourceMap": false,
"instrument": false
},
"homepage": "https://github.com/stipsan/uikit-react",
"devDependencies": {
"@kadira/react-storybook-addon-info": "3.1.1",
"@kadira/storybook": "1.34.1",
"@kadira/storybook": "2.0.0",
"@kadira/storybook-deployer": "1.0.0",
"autoprefixer": "6.3.7",
"babel-cli": "6.11.4",
"babel-core": "6.10.4",
"babel-core": "6.11.4",
"babel-eslint": "6.1.2",
"babel-plugin-istanbul": "1.1.0",
"babel-plugin-react-transform": "2.0.2",
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-react-inline-elements": "6.8.0",
"babel-polyfill": "6.9.1",
"babel-preset-es2015": "6.9.0",
"babel-preset-react": "6.11.1",
"babel-preset-stage-0": "6.5.0",
Expand All @@ -61,11 +74,12 @@
"extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.9.0",
"growl": "1.9.2",
"istanbul": "1.0.0-alpha.2",
"jsdom": "9.2.1",
"istanbul": "1.1.0-alpha.1",
"jsdom": "9.4.1",
"json-loader": "0.5.4",
"mocha": "3.0.0",
"node-sass": "3.8.0",
"nyc": "7.1.0",
"postcss-loader": "0.9.1",
"raw-loader": "^0.5.1",
"react": "15.3.0",
Expand Down

0 comments on commit 98862ac

Please sign in to comment.