Browse Source

only report coverage to coveralls from travis

this has the nice side effect that `npm test` effectively only runs `mocha` and has proper line numbers in stack traces
jomo 10 years ago
parent
commit
4dec71c75e
2 changed files with 4 additions and 3 deletions
  1. 2 2
      .travis.yml
  2. 2 1
      package.json

+ 2 - 2
.travis.yml

@@ -1,10 +1,10 @@
 language: node_js
 language: node_js
 node_js:
 node_js:
   - "iojs-v1.6.0"
   - "iojs-v1.6.0"
-before_script:
-  - cp "lib/config.example.js" "lib/config.js"
 before_install:
 before_install:
   - sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
   - sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
+script:
+  - npm run-script test-travis
 notifications:
 notifications:
   irc:
   irc:
     channels:
     channels:

+ 2 - 1
package.json

@@ -23,7 +23,8 @@
   "scripts": {
   "scripts": {
     "postinstall": "cp 'lib/config.example.js' 'lib/config.js'",
     "postinstall": "cp 'lib/config.example.js' 'lib/config.js'",
     "start": "forever -l logs/log.log -o logs/out.log -e logs/error.log -p ./ -a --minUptime 8000 --spinSleepTime 1500 lib/www.js",
     "start": "forever -l logs/log.log -o logs/out.log -e logs/error.log -p ./ -a --minUptime 8000 --spinSleepTime 1500 lib/www.js",
-    "test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
+    "test": "mocha",
+    "test-travis": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
   },
   },
   "engines": {
   "engines": {
     "iojs": "1.6.x"
     "iojs": "1.6.x"