Skip to content
Snippets Groups Projects
Unverified Commit 41e020bc authored by Jordan Harband's avatar Jordan Harband
Browse files

[Tests] improvements:

 - `node` `v7`/`v4.6`; drop `v5`
 - re-enable karma builds, but allow them to fail
 - correct before_script settings for karma tests
 - install appropriate react version, per `$REACT`
 - Ensure tests aren’t ran twice
parent 5385116f
No related branches found
No related tags found
No related merge requests found
language: node_js
node_js:
- "7"
- "6"
- "5"
- "4"
- "4.2"
- "4.6"
- "iojs"
before_script:
- 'if [ "${TRAVIS_NODE_VERSION}" = 6 ]; then export DISPLAY=:99.0; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" = 6 ]; then sh -e /etc/init.d/xvfb start; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" = 6 ]; then sleep 3; fi'
- 'if [ -n "${KARMA-}" ]; then export DISPLAY=:99.0; fi'
- 'if [ -n "${KARMA-}" ]; then sh -e /etc/init.d/xvfb start; fi'
- 'if [ -n "${KARMA-}" ]; then sleep 3; fi'
- 'if [ -n "${REACT-}" ] && [ -n "${TEST-}" ]; then sh install-relevant-react.sh; fi'
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 tests-only; fi'
after_success:
- 'if [ "${TRAVIS_NODE_VERSION}" = "4.2" ]; then npm run cover; cat ./coverage/lcov.info | ./node_modules/.bin/coveralls ; fi'
env:
global:
- REACT=0.14
matrix:
- TEST=true
matrix:
- REACT=0.14
- REACT=15
sudo: false
matrix:
fast_finish: true
include:
# - node_js: "node"
# env: KARMA=true
- node_js: "node"
env: KARMA=true
- node_js: "node"
env: LINT=true
allow_failures:
- node_js: "iojs"
- env: KARMA=true
#!/bin/sh
REACT=${REACT:-15}
echo "installing React $REACT"
if [ "$REACT" = "0.14" ]; then
npm run react:14
fi
if [ "$REACT" = "15" ]; then
npm run react:15
fi
......@@ -15,6 +15,9 @@
"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",
"react:clean": "rimraf node_modules/react node_modules/react-dom node_modules/react-addons-test-utils",
"react:14": "rimraf node_modules/.bin/npm && npm run react:clean && npm i react@0.14 react-dom@0.14 react-addons-test-utils@0.14",
"react:15": "rimraf node_modules/.bin/npm && npm run react:clean && npm i react@15 react-dom@15 react-addons-test-utils@15",
"pretest": "npm run --silent lint",
"tests-only": "npm run mocha --silent test",
"tests-karma": "karma start",
......
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