Added Babel preprocessor to convert ES6 js files
diff --git a/xos/core/xoslib/karma.conf.js b/xos/core/xoslib/karma.conf.js
index e991fe3..12f47f7 100644
--- a/xos/core/xoslib/karma.conf.js
+++ b/xos/core/xoslib/karma.conf.js
@@ -24,7 +24,7 @@
'static/js/vendor/backbone.syphon.js',
'static/js/xoslib/*.js',
- 'spec/*.test.js'
+ 'spec/**/*.test.js'
],
@@ -36,6 +36,7 @@
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
+ 'spec/**/*.test.js': ['babel']
},
diff --git a/xos/core/xoslib/package.json b/xos/core/xoslib/package.json
index 795c17f..bcfc27e 100644
--- a/xos/core/xoslib/package.json
+++ b/xos/core/xoslib/package.json
@@ -14,6 +14,7 @@
"karma-jasmine": "~0.3.6",
"phantomjs": "~1.9.18",
"karma-phantomjs-launcher": "~0.2.1",
- "karma-mocha-reporter": "~1.1.1"
+ "karma-mocha-reporter": "~1.1.1",
+ "karma-babel-preprocessor": "~5.2.2"
}
}
diff --git a/xos/core/xoslib/spec/.eslintrc b/xos/core/xoslib/spec/.eslintrc
new file mode 100644
index 0000000..1fbd34e
--- /dev/null
+++ b/xos/core/xoslib/spec/.eslintrc
@@ -0,0 +1,46 @@
+{
+ "ecmaFeatures": {
+ "blockBindings": true,
+ "forOf" : true,
+ "generators": true,
+ "destructuring": true,
+ "forOf": true,
+ "arrowFunctions": true,
+ "templateStrings": true,
+ "destructuring": true,
+ "forOf": true,
+ "arrowFunctions": true,
+ "templateStrings": true,
+ "generators": true
+ },
+ "env" : {
+ "browser": true,
+ "node": true,
+ "es6": true
+ },
+ "rules" : {
+ "quotes": [1, "single"],
+ "camelcase": [0],
+ "no-underscore-dangle": [0],
+ "eqeqeq": [1],
+ "no-alert": [1],
+ "no-unused-vars": [1],
+ "key-spacing": [2, {
+ "beforeColon": false,
+ "afterColon": true
+ }],
+ "indent": [2, 2]
+ },
+ "globals": {
+ "console": false,
+ "describe": false,
+ "xdescribe": false,
+ "it": false,
+ "xit": false,
+ "before": false,
+ "beforeEach": false,
+ "after": false,
+ "afterEach": false,
+ "expect": false
+ }
+}
diff --git a/xos/core/xoslib/spec/smoke.test.js b/xos/core/xoslib/spec/smoke.test.js
index 99bbef3..2c27544 100644
--- a/xos/core/xoslib/spec/smoke.test.js
+++ b/xos/core/xoslib/spec/smoke.test.js
@@ -1,5 +1,7 @@
-describe('The test environment', function() {
- it('should correctly work', function(){
+'use strict';
+
+describe('The test environment', () => {
+ it('should correctly work', () => {
expect(true).toBe(true);
});
-});
\ No newline at end of file
+});