You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/12/16 22:02:13 UTC

[05/51] [abbrv] ambari git commit: AMBARI-19215 Integrate karma with babel preprocessor. (atkach)

AMBARI-19215 Integrate karma with babel preprocessor. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/791a24cd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/791a24cd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/791a24cd

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 791a24cda09a2fb97e2a36fbb9653c6f9b487ec1
Parents: fb56775
Author: Andrii Tkach <at...@apache.org>
Authored: Thu Dec 15 19:02:52 2016 +0200
Committer: Andrii Tkach <at...@apache.org>
Committed: Fri Dec 16 12:31:14 2016 +0200

----------------------------------------------------------------------
 ambari-web/karma.conf.js | 19 ++++++++++++++++---
 ambari-web/package.json  | 29 ++++++++++++++++-------------
 2 files changed, 32 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/791a24cd/ambari-web/karma.conf.js
----------------------------------------------------------------------
diff --git a/ambari-web/karma.conf.js b/ambari-web/karma.conf.js
index 7442b95..c6e80fc 100644
--- a/ambari-web/karma.conf.js
+++ b/ambari-web/karma.conf.js
@@ -29,7 +29,8 @@ module.exports = function(config) {
       'karma-phantomjs-launcher',
       'karma-coverage',
       'karma-ember-precompiler-brunch',
-      'karma-commonjs-require'
+      'karma-commonjs-require',
+      'karma-babel-preprocessor'
     ],
 
     // frameworks to use
@@ -114,8 +115,20 @@ module.exports = function(config) {
     preprocessors: {
       '!(vendor|node_modules|test)/**/!(karma_setup|tests).js': 'coverage',
       'app/templates/**/*.hbs': ['ember-precompiler-brunch', 'common-require'],
-      'app!(assets)/**/!(karma_setup|tests).js': ['common-require'],
-      'test/**/*.js': ['common-require']
+      'app!(assets)/**/!(karma_setup|tests).js': ['common-require', 'babel'],
+      'test/**/*.js': ['common-require', 'babel']
+    },
+
+    babelPreprocessor: {
+      options: {
+        presets: ['es2015']
+      },
+      filename: function (file) {
+        return file.originalPath.replace(/\.js$/, '.js');
+      },
+      sourceFileName: function (file) {
+        return file.originalPath;
+      }
     },
 
     // list of files to exclude

http://git-wip-us.apache.org/repos/asf/ambari/blob/791a24cd/ambari-web/package.json
----------------------------------------------------------------------
diff --git a/ambari-web/package.json b/ambari-web/package.json
index ad3a9fa..acd6bcc 100644
--- a/ambari-web/package.json
+++ b/ambari-web/package.json
@@ -21,22 +21,25 @@
     "assetsmanager-brunch": "~1.8.1"
   },
   "devDependencies": {
-    "phantomjs": "~2.1.0",
-    "mocha":"2.5.3",
-    "mocha-phantomjs": "~4.1.0",
-    "mocha-phantomjs-core": "~2.1.0",
-    "chai":"~3.5.0",
-    "sinon":"=1.7.3",
-    "sinon-chai":"~2.8.0",
-    "express":"2.5.8",
+    "babel": "^6.5.2",
+    "babel-preset-es2015": "^6.18.0",
+    "chai": "~3.5.0",
+    "express": "2.5.8",
     "karma": ">=0.11.14",
-    "karma-mocha": "0.1.1",
+    "karma-babel-preprocessor": "^6.0.1",
     "karma-chai": "~0.1.0",
-    "karma-sinon": "~1.0.2",
-    "karma-phantomjs-launcher": "1.0.2",
-    "karma-coverage": "~0.2.0",
     "karma-commonjs-require": "~0.0.1",
-    "karma-ember-precompiler-brunch": "^1.0.0"
+    "karma-coverage": "~0.2.0",
+    "karma-ember-precompiler-brunch": "^1.0.0",
+    "karma-mocha": "0.1.1",
+    "karma-phantomjs-launcher": "1.0.2",
+    "karma-sinon": "~1.0.2",
+    "mocha": "2.5.3",
+    "mocha-phantomjs": "~4.1.0",
+    "mocha-phantomjs-core": "~2.1.0",
+    "phantomjs": "~2.1.0",
+    "sinon": "=1.7.3",
+    "sinon-chai": "~2.8.0"
   },
   "scripts": {
     "start": "brunch watch --server",