From 9a06ca2eb37c5aa7442b1204c3ff4b43ea7dd574 Mon Sep 17 00:00:00 2001
From: Tankred Hase <mail@tankredhase.de>
Date: Tue, 2 Feb 2016 14:41:12 +0700
Subject: [PATCH] Check code coverage only under node v0.12 => faster

---
 .travis.yml |  2 +-
 travis.sh   | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index bc7f3a7f..b7d020f4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,7 +7,7 @@ matrix:
   fast_finish: true
   include:
     - node_js: "0.12"
-      env: OPENPGPJSTEST='unit' OPENPGP_NODE_JS='0.12'
+      env: OPENPGPJSTEST='coverage' OPENPGP_NODE_JS='0.12'
     - node_js: "4.2"
       env: OPENPGPJSTEST='unit' OPENPGP_NODE_JS='4.2'
     - node_js: "5"
diff --git a/travis.sh b/travis.sh
index 64c20ae1..9e368acd 100755
--- a/travis.sh
+++ b/travis.sh
@@ -2,13 +2,17 @@
 
 set -e
 
-if [ $OPENPGPJSTEST = "unit" ]; then
-  echo "Running OpenPGP.js unit-tests"
+if [ $OPENPGPJSTEST = "coverage" ]; then
+  echo "Running OpenPGP.js unit tests on node.js with code coverage."
   grunt coverage
   codeclimate-test-reporter < coverage/lcov.info
 
+elif [ $OPENPGPJSTEST = "unit" ]; then
+  echo "Running OpenPGP.js unit tests on node.js."
+  npm test
+
 elif [[ $OPENPGPJSTEST =~ ^end2end-.* ]]; then
-  echo "Running browser-testing on Saucelabs"
+  echo "Running OpenPGP.js browser unit tests on Saucelabs."
 
   declare -a capabilities=(
     "export SELENIUM_BROWSER_CAPABILITIES='{\"browserName\":\"firefox\", \"version\":\"38.0\", \"platform\":\"Linux\"}'"