Skip to content

Commit

Permalink
test(ci): add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
z.w committed May 25, 2016
1 parent 2a81206 commit 2c3f87b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["react-native"]
}
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js
sudo: true
node_js:
- "4.4"
- "4.2"
cache:
directories:
- node_modules
before_install:
- npm install
script:
- npm test
after_script:
- npm run coverage
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "node ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha ./test/*.test.js",
"coverage": "cat ./coverage/lcov.info | coveralls",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"repository": {
Expand All @@ -25,7 +26,18 @@
"moment": "2.x.x"
},
"devDependencies": {
"cz-conventional-changelog": "^1.1.6"
"babel": "^6.5.2",
"babel-preset-react-native": "^1.8.0",
"chai": "^3.5.0",
"cz-conventional-changelog": "^1.1.6",
"enzyme": "^2.3.0",
"istanbul": "^1.0.0-alpha.2",
"mocha": "^2.5.2",
"react": "^0.14.8",
"react-addons-test-utils": "^0.14.8",
"react-dom": "^0.14.8",
"react-native": "^0.24.1",
"react-native-mock": "^0.2.0"
},
"config": {
"commitizen": {
Expand Down
15 changes: 15 additions & 0 deletions test/index.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--colors
--require ./node_modules/react-native-mock/mock.js
--compilers js:babel-core/register
--recursive

0 comments on commit 2c3f87b

Please sign in to comment.