Repository: climate
Updated Branches:
  refs/heads/master 69bbe2736 -> 59dbe805b


CLIMATE-413 Extend browser support for ocw-ui/frontend/config/karma.conf.js


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/5a632c86
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/5a632c86
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/5a632c86

Branch: refs/heads/master
Commit: 5a632c86e4e10e545940ec4ad420ec232f22a413
Parents: 4cf79f3
Author: Michael Anderson <michaelanderson@Michaels-iMac.local>
Authored: Sun Jan 7 18:50:15 2018 -0500
Committer: Michael Anderson <michaelanderson@Michaels-iMac.local>
Committed: Sun Jan 7 18:50:15 2018 -0500

----------------------------------------------------------------------
 ocw-ui/frontend/package.json       | 22 +++++++++++------
 ocw-ui/frontend/test/karma.conf.js | 43 ++++++++++++++++++++++++++++-----
 2 files changed, 51 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/5a632c86/ocw-ui/frontend/package.json
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend/package.json b/ocw-ui/frontend/package.json
index 8024f17..b0133c8 100644
--- a/ocw-ui/frontend/package.json
+++ b/ocw-ui/frontend/package.json
@@ -2,12 +2,12 @@
   "name": "ocwui",
   "version": "1.2.0",
   "description": "A tool for the evaluation and analysis of climate models.",
-  "repository": { 
-    "type" : "git", 
-    "url" : "https://git-wip-us.apache.org/repos/asf/climate.git";
+  "repository": {
+    "type": "git",
+    "url": "https://git-wip-us.apache.org/repos/asf/climate.git";
   },
   "license": "Apache-2.0",
-  "readme":"README.md",
+  "readme": "README.md",
   "dependencies": {},
   "devDependencies": {
     "bower": "^1.3.9",
@@ -23,7 +23,7 @@
     "grunt-contrib-copy": "^0.5.0",
     "grunt-contrib-cssmin": "^0.9.0",
     "grunt-contrib-htmlmin": "^0.3.0",
-    "grunt-contrib-imagemin": "^0.7.0",
+    "grunt-contrib-imagemin": "^2.0.1",
     "grunt-contrib-jshint": "^0.10.0",
     "grunt-contrib-uglify": "^0.4.0",
     "grunt-contrib-watch": "^0.6.1",
@@ -36,12 +36,18 @@
     "grunt-usemin": "^2.1.1",
     "grunt-wiredep": "^1.8.0",
     "jshint-stylish": "^0.2.0",
-    "karma": "^0.12.17",
+    "karma": "^2.0.0",
+    "karma-chrome-launcher": "^2.2.0",
+    "karma-detect-browsers": "^2.2.6",
+    "karma-firefox-launcher": "^1.1.0",
+    "karma-ie-launcher": "^1.0.0",
     "karma-jasmine": "^0.1.5",
-    "karma-phantomjs-launcher": "^0.1.4",
+    "karma-phantomjs-launcher": "^1.0.4",
+    "karma-safari-launcher": "^1.0.0",
     "load-grunt-tasks": "^0.4.0",
     "time-grunt": "^0.3.1",
-    "yo": "^1.2.1"
+    "yo": "^1.2.1",
+    "serve-static": "^1.13.1"
   },
   "engines": {
     "node": ">=0.10.0"

http://git-wip-us.apache.org/repos/asf/climate/blob/5a632c86/ocw-ui/frontend/test/karma.conf.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend/test/karma.conf.js 
b/ocw-ui/frontend/test/karma.conf.js
index 744d927..fa03fd7 100644
--- a/ocw-ui/frontend/test/karma.conf.js
+++ b/ocw-ui/frontend/test/karma.conf.js
@@ -46,23 +46,54 @@ module.exports = function(config) {
     // web server port
     port: 8080,
 
+
     // Start these browsers, currently available:
     // - Chrome
-    // - ChromeCanary
     // - Firefox
-    // - Opera
     // - Safari (only Mac)
     // - PhantomJS
     // - IE (only Windows)
-    browsers: [
-      'PhantomJS',
-      //'Chrome'
-    ],
+    // Ok to leave this empty as karma-detect-browsers will figure this out 
based on what is installed.
+    // Either set enabled to false for karma-detect-browsers and fill in a 
specific list or update
+    // the logic in the karma-detect-browsers config to remove those you don't 
want to test.
+    browsers: [ ],
+
+    frameworks: ['jasmine', 'detectBrowsers'],
+
+    detectBrowsers: {
+      // enable/disable, default is true
+      enabled: true,
+
+      // enable/disable phantomjs support, default is true
+      usePhantomJS: true,
+
+      // post processing of browsers list
+      // here you can edit the list of browsers used by karma
+      postDetection: function(availableBrowser) {
+
+          var result = availableBrowser;
+
+          //Remove PhantomJS if another browser has been detected
+          //if (availableBrowser.length > 1 && 
availableBrowser.indexOf('PhantomJS')>-1) {
+          //  var i = result.indexOf('PhantomJS');
+
+          //  if (i !== -1) {
+          //    result.splice(i, 1);
+          //  }
+          //}
+
+          return result;
+        }
+    },
 
     // Which plugins to enable
     plugins: [
       'karma-phantomjs-launcher',
       'karma-chrome-launcher',
+      'karma-firefox-launcher',
+      'karma-safari-launcher',
+      'karma-ie-launcher',
+      'karma-detect-browsers',
       'karma-jasmine'
     ],
 

Reply via email to