Skip to content

Commit

Permalink
Add codecov support
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Sep 10, 2017
1 parent c0ee179 commit bc30340
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ npm-debug.log
.DS_Store
/lib
/demo
/test/coverage
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ script:
- npm run build:compile
- npm run build:demo
after_success:
- npm run coverage
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && sshpass -e scp -r -o stricthostkeychecking=no demo/* $DEPLOY_DEST
env:
global:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ReactPlayer
[![Build Status](https://img.shields.io/travis/CookPete/react-player/master.svg)](https://travis-ci.org/CookPete/react-player)
[![Dependency Status](https://img.shields.io/david/CookPete/react-player.svg)](https://david-dm.org/CookPete/react-player)
[![devDependency Status](https://img.shields.io/david/dev/CookPete/react-player.svg)](https://david-dm.org/CookPete/react-player?type=dev)
[![Test Coverage](https://img.shields.io/codecov/c/github/cookpete/react-player/codecov.svg)](https://codecov.io/gh/CookPete/react-player)
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/ckpt)

A react component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vidme, Vimeo, Wistia and DailyMotion.
Expand Down
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build:compile": "cross-env NODE_ENV=production babel src -d lib --ignore src/demo",
"start": "webpack-dev-server",
"lint": "standard --verbose | snazzy",
"test": "babel-node ./node_modules/karma/bin/karma start test/karma.config.js",
"test": "cross-env NODE_ENV=test babel-node ./node_modules/karma/bin/karma start test/karma.config.js",
"coverage": "codecov",
"preversion": "npm run lint",
"version": "npm run update-changelog && npm run build:browser && git add CHANGELOG.md dist",
"update-changelog": "auto-changelog --package --template compact",
Expand Down Expand Up @@ -51,12 +52,14 @@
"babel-eslint": "^7.0.0",
"babel-loader": "^7.0.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-istanbul": "^4.1.4",
"babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
"babel-plugin-transform-es3-property-literals": "^6.8.0",
"babel-preset-es2015": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-0": "^6.16.0",
"chai": "^4.0.2",
"codecov": "^2.3.0",
"cross-env": "^5.0.1",
"css-loader": "^0.28.0",
"es6-promise": "^4.0.3",
Expand All @@ -67,6 +70,7 @@
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.0",
"karma-mocha": "^1.2.0",
"karma-mocha-reporter": "^2.2.0",
Expand Down Expand Up @@ -107,6 +111,11 @@
"transform-es3-member-expression-literals",
"transform-es3-property-literals"
]
},
"test": {
"plugins": [
"istanbul"
]
}
}
},
Expand Down
8 changes: 7 additions & 1 deletion test/karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function (config) {
preprocessors: {
'karma.webpack.js': [ 'webpack', 'sourcemap' ]
},
reporters: [ 'mocha' ],
reporters: [ 'mocha', 'coverage' ],
webpack: {
...webpackConfig,
devtool: 'inline-source-map'
Expand All @@ -30,6 +30,12 @@ export default function (config) {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
coverageReporter: {
dir: 'coverage',
reporters: [
{ type: 'lcov', subdir: '.' }
]
}
})
}
Loading

0 comments on commit bc30340

Please sign in to comment.