repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 36a095af4f5c0692e26be1352fc386aae864ed8b:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 36a095af4f5c0692e26be1352fc386aae864ed8b
Author: James Baicoianu 
Date:   Sun May 29 15:43:28 2016 -0700

    Run Karma tests from Travis-CI

diff --git a/.travis.yml b/.travis.yml
index 7b359bb50345d864de040a59001448072cf93184..
index ..22f2c49620593cba2fca2c30158e5fa5cad4762a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,11 @@
 language: node_js
 node_js:
   - "0.10"
-after_install:
+before_install:
+  - export CHROME_BIN=chromium-browser
+  - export DISPLAY=:99.0
+  - sh -e /etc/init.d/xvfb start
+
+before_script:
   - "./utils/build.sh"

diff --git a/package.json b/package.json
index fc1e89e3c86edd996435a206f75a8c43bc510ea8..
index ..8f9e797f33daab911ca3c90955e41310c3c8e612 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,14 @@
   "scripts": {
     "postinstall": "./utils/init.sh",
     "build": "./utils/build.sh"
+    "test": "./node_modules/.bin/karma start tests/karma.conf.js --single-run "
   },
+
+  'devDependencies': {
+    'karma': '~0.13',
+    'jasmine': '>=2.0'
+  },
+
   "repository": {
     "type": "git",
     "url": "https://github.com/jbaicoianu/janusweb"
diff --git a/tests/karma.conf.js b/tests/karma.conf.js
index 1d406886a083bd074be56e66a7214e57066239a1..
index ..f17f5a9b2bca9c2ee6a7318e71e64123441eac44 100644
--- a/tests/karma.conf.js
+++ b/tests/karma.conf.js
@@ -2,7 +2,7 @@
 // Generated on Sun May 08 2016 23:14:26 GMT-0700 (PDT)

 module.exports = function(config) {
-  config.set({
+  var settings = {

     // base path that will be used to resolve all patterns (eg. files, exclude)
     basePath: '..',
@@ -55,6 +55,13 @@ module.exports = function(config) {
     // enable / disable watching file and executing tests whenever any file changes
     autoWatch: true,

+    customLaunchers: {
+        Chrome_travis_ci: {
+            base: 'Chrome',
+            flags: ['--no-sandbox']
+        }
+    },
+

     // start these browsers
     // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
@@ -68,5 +75,11 @@ module.exports = function(config) {
     // Concurrency level
     // how many browser should be started simultaneous
     concurrency: Infinity
-  })
+  };
+
+  if (process.env.TRAVIS) {
+    settings.browsers = ['Chrome_travis_ci'];
+  }
+
+  config.set(settings);
 }

-----END OF PAGE-----