cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From audre...@apache.org
Subject [3/8] android commit: CB-12895 : fixed eslint errors
Date Fri, 23 Jun 2017 17:18:18 GMT
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/bin/templates/project/assets/www/js/index.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/assets/www/js/index.js b/bin/templates/project/assets/www/js/index.js
index c31cd83..f6d6793 100644
--- a/bin/templates/project/assets/www/js/index.js
+++ b/bin/templates/project/assets/www/js/index.js
@@ -18,25 +18,25 @@
  */
 var app = {
     // Application Constructor
-    initialize: function() {
+    initialize: function () {
         this.bindEvents();
     },
     // Bind Event Listeners
     //
     // Bind any events that are required on startup. Common events are:
     // 'load', 'deviceready', 'offline', and 'online'.
-    bindEvents: function() {
+    bindEvents: function () {
         document.addEventListener('deviceready', this.onDeviceReady, false);
     },
     // deviceready Event Handler
     //
     // The scope of 'this' is the event. In order to call the 'receivedEvent'
     // function, we must explicitly call 'app.receivedEvent(...);'
-    onDeviceReady: function() {
+    onDeviceReady: function () {
         app.receivedEvent('deviceready');
     },
     // Update DOM on a Received Event
-    receivedEvent: function(id) {
+    receivedEvent: function (id) {
         var parentElement = document.getElementById(id);
         var listeningElement = parentElement.querySelector('.listening');
         var receivedElement = parentElement.querySelector('.received');
@@ -48,4 +48,4 @@ var app = {
     }
 };
 
-app.initialize();
\ No newline at end of file
+app.initialize();

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index bb6c120..5b78eb7 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
     "shelljs"
   ],
   "devDependencies": {
-    "eslint": "^4.0.0",
+    "eslint": "^3.19.0",
     "eslint-config-semistandard": "^11.0.0",
     "eslint-config-standard": "^10.2.1",
     "eslint-plugin-import": "^2.3.0",

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/e2e/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/create.spec.js b/spec/e2e/create.spec.js
index d646535..3eaf9c7 100644
--- a/spec/e2e/create.spec.js
+++ b/spec/e2e/create.spec.js
@@ -16,12 +16,13 @@
  specific language governing permissions and limitations
  under the License.
  */
+/* eslint-env jasmine */
 
 var actions = require('./helpers/projectActions.js');
 
 var CREATE_TIMEOUT = 180000;
 
-function createAndBuild(projectname, projectid, done) {
+function createAndBuild (projectname, projectid, done) {
     actions.createProject(projectname, projectid, function (error) {
         expect(error).toBe(null);
         actions.buildProject(projectid, function (error) {
@@ -32,45 +33,44 @@ function createAndBuild(projectname, projectid, done) {
     });
 }
 
+describe('create', function () {
 
-describe('create', function() {
-
-    it('Test#001 : create project with ascii name, no spaces', function(done) {
+    it('Test#001 : create project with ascii name, no spaces', function (done) {
         var projectname = 'testcreate';
         var projectid = 'com.test.create.app1';
 
         createAndBuild(projectname, projectid, done);
     }, CREATE_TIMEOUT);
 
-    it('Test#002 : create project with ascii name, and spaces', function(done) {
+    it('Test#002 : create project with ascii name, and spaces', function (done) {
         var projectname = 'test create';
         var projectid = 'com.test.create.app2';
 
         createAndBuild(projectname, projectid, done);
     }, CREATE_TIMEOUT);
 
-    it('Test#003 : create project with unicode name, no spaces', function(done) {
+    it('Test#003 : create project with unicode name, no spaces', function (done) {
         var projectname = '応応応応用用用用';
         var projectid = 'com.test.create.app3';
 
         createAndBuild(projectname, projectid, done);
     }, CREATE_TIMEOUT);
 
-    it('Test#004 : create project with unicode name, and spaces', function(done) {
+    it('Test#004 : create project with unicode name, and spaces', function (done) {
         var projectname = '応応応応 用用用用';
         var projectid = 'com.test.create.app4';
 
         createAndBuild(projectname, projectid, done);
     }, CREATE_TIMEOUT);
 
-    it('Test#005 : create project with ascii+unicode name, no spaces', function(done) {
+    it('Test#005 : create project with ascii+unicode name, no spaces', function (done) {
         var projectname = '応応応応hello用用用用';
         var projectid = 'com.test.create.app5';
 
         createAndBuild(projectname, projectid, done);
     }, CREATE_TIMEOUT);
 
-    it('Test#006 : create project with ascii+unicode name, and spaces', function(done) {
+    it('Test#006 : create project with ascii+unicode name, and spaces', function (done) {
         var projectname = '応応応応 hello 用用用用';
         var projectid = 'com.test.create.app6';
 

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/e2e/helpers/projectActions.js
----------------------------------------------------------------------
diff --git a/spec/e2e/helpers/projectActions.js b/spec/e2e/helpers/projectActions.js
index 1c67c64..4e3d8f2 100644
--- a/spec/e2e/helpers/projectActions.js
+++ b/spec/e2e/helpers/projectActions.js
@@ -17,11 +17,11 @@
  under the License.
  */
 
-var PluginInfoProvider = require('cordova-common').PluginInfoProvider,
-    shell = require('shelljs'),
-    cp    = require('child_process'),
-    path  = require('path'),
-    util  = require('util');
+var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
+var shell = require('shelljs');
+var cp = require('child_process');
+var path = require('path');
+var util = require('util');
 
 var cordova_bin = path.join(__dirname, '../../../bin');
 
@@ -70,7 +70,7 @@ module.exports.updateProject = function (projectid, platformpath, callback) {
     var projectDirName = getDirName(projectid);
     var updateScriptPath = platformpath ? path.join(platformpath, 'bin/update') : path.join(cordova_bin, 'update');
     var command = util.format('%s %s', updateScriptPath, projectDirName);
-    
+
     cp.exec(command, function (error, stdout, stderr) {
         if (error) {
             console.log(stdout);
@@ -78,7 +78,7 @@ module.exports.updateProject = function (projectid, platformpath, callback) {
         }
         callback(error);
     });
-    
+
 };
 
 /**
@@ -115,7 +115,7 @@ module.exports.removeProject = function (projectid) {
  * @param {function} callback - function which is called (without arguments) when the plugin is added or (with error object) when error occurs
  */
 module.exports.addPlugin = function (projectid, plugindir, callback) {
-	var projectDirName = getDirName(projectid);
+    var projectDirName = getDirName(projectid);
     var pip = new PluginInfoProvider();
     var pluginInfo = pip.get(plugindir);
     var Api = require(path.join(__dirname, '../../..', projectDirName, 'cordova', 'Api.js'));
@@ -126,7 +126,7 @@ module.exports.addPlugin = function (projectid, plugindir, callback) {
     }, function (error) {
         console.error(error);
         callback(error);
-    });  
+    });
 };
 
 /**
@@ -136,7 +136,7 @@ module.exports.addPlugin = function (projectid, plugindir, callback) {
  */
 module.exports.getPlatformVersion = function (projectid, callback) {
     var command = path.join(getDirName(projectid), 'cordova/version');
-    
+
     cp.exec(command, function (error, stdout, stderr) {
         if (error) {
             console.log(stdout);
@@ -146,6 +146,6 @@ module.exports.getPlatformVersion = function (projectid, callback) {
     });
 };
 
-function getDirName(projectid) {
+function getDirName (projectid) {
     return 'test-' + projectid;
 }

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/e2e/plugin.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/plugin.spec.js b/spec/e2e/plugin.spec.js
index 7cc5032..75405b9 100644
--- a/spec/e2e/plugin.spec.js
+++ b/spec/e2e/plugin.spec.js
@@ -16,15 +16,16 @@
  specific language governing permissions and limitations
  under the License.
  */
+/* eslint-env jasmine */
 
-var path    = require('path'),
-    actions = require('./helpers/projectActions.js');
+var path = require('path');
+var actions = require('./helpers/projectActions.js');
 
 var PLUGIN_ADD_TIMEOUT = 90000;
 
-describe('plugin add', function() {
+describe('plugin add', function () {
 
-    it('Test#001 : create project and add a plugin with framework', function(done) {
+    it('Test#001 : create project and add a plugin with framework', function (done) {
         var projectname = 'testpluginframework';
         var projectid = 'com.test.plugin.framework';
         var fakePluginPath = path.join(__dirname, 'fixtures/cordova-plugin-fake');

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/e2e/update.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/update.spec.js b/spec/e2e/update.spec.js
index cda100e..9ce8c2a 100644
--- a/spec/e2e/update.spec.js
+++ b/spec/e2e/update.spec.js
@@ -16,23 +16,24 @@
  specific language governing permissions and limitations
  under the License.
  */
+/* eslint-env jasmine */
 
-var actions      = require('./helpers/projectActions.js'),
-    shell        = require('shelljs'),
-    fs           = require('fs'),
-    util         = require('util'),
-    platformOld  = { version: '4.0.0', path: 'cordova-android-old' },
-    platformEdge = { version: getCurrentVersion(), path: '.' };
+var actions = require('./helpers/projectActions.js');
+var shell = require('shelljs');
+var fs = require('fs');
+var util = require('util');
+var platformOld = { version: '4.0.0', path: 'cordova-android-old' };
+var platformEdge = { version: getCurrentVersion(), path: '.' };
 
-var DOWNLOAD_TIMEOUT = 2 * 60 * 1000,
-    UPDATE_TIMEOUT   = 90 * 1000,
-    PLATFORM_GIT_URL = 'https://github.com/apache/cordova-android';
+var DOWNLOAD_TIMEOUT = 2 * 60 * 1000;
+var UPDATE_TIMEOUT = 90 * 1000;
+var PLATFORM_GIT_URL = 'https://github.com/apache/cordova-android';
 
-function getCurrentVersion() {
+function getCurrentVersion () {
     return fs.readFileSync('VERSION').toString().trim();
 }
 
-function testUpdate(projectname, projectid, createfrom, updatefrom, doBuild, done) {
+function testUpdate (projectname, projectid, createfrom, updatefrom, doBuild, done) {
     actions.createProject(projectname, projectid, createfrom.path, function (error) {
         expect(error).toBe(null);
         actions.updateProject(projectid, updatefrom.path, function (error) {
@@ -68,9 +69,9 @@ describe('preparing fixtures', function () {
 
 });
 
-describe('update', function() {
+describe('update', function () {
 
-    it('Test#002 : should update major version and build the project', function(done) {
+    it('Test#002 : should update major version and build the project', function (done) {
         var projectname = 'testupdate';
         var projectid = 'com.test.update.app1';
 
@@ -82,7 +83,7 @@ describe('update', function() {
 
 describe('cleanup', function () {
 
-    it('Test#004 : remove cloned old platform', function() {
+    it('Test#004 : remove cloned old platform', function () {
         shell.rm('-rf', platformOld.path);
     });
 

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js
----------------------------------------------------------------------
diff --git a/spec/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js b/spec/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js
index 631d6da..e69de29 100644
--- a/spec/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js
+++ b/spec/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js
@@ -1 +0,0 @@
-./org.test.plugins.dummyplugin/www/dummyplugin.js

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/AndroidProject.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/AndroidProject.spec.js b/spec/unit/AndroidProject.spec.js
index 32ff097..532787f 100644
--- a/spec/unit/AndroidProject.spec.js
+++ b/spec/unit/AndroidProject.spec.js
@@ -16,14 +16,15 @@
     specific language governing permissions and limitations
     under the License.
 */
+/* eslint-env jasmine */
 
 var path = require('path');
 var AndroidProject = require('../../bin/templates/cordova/lib/AndroidProject');
 var android_project = path.join(__dirname, '../fixtures/android_project');
 
-describe('AndroidProject class', function() {
-    describe('getPackageName method', function() {
-        it('Test#001 : should return an android project\'s proper package name', function() {
+describe('AndroidProject class', function () {
+    describe('getPackageName method', function () {
+        it('Test#001 : should return an android project\'s proper package name', function () {
             expect(AndroidProject.getProjectFile(android_project).getPackageName())
                 .toEqual('com.alunny.childapp');
         });

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/AndroidStudio.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/AndroidStudio.spec.js b/spec/unit/AndroidStudio.spec.js
index 95d5f4b..e485d0a 100644
--- a/spec/unit/AndroidStudio.spec.js
+++ b/spec/unit/AndroidStudio.spec.js
@@ -1,17 +1,17 @@
 
+/* eslint-env jasmine */
 var path = require('path');
 var AndroidStudio = require('../../bin/templates/cordova/lib/AndroidStudio');
 
-
 describe('AndroidStudio module', function () {
-    it('should return true for Android Studio project', function() {
-      var root = path.join(__dirname,'../fixtures/android_studio_project/');
-      var isAndStud = AndroidStudio.isAndroidStudioProject(root);
-      expect(isAndStud).toBe(true);
+    it('should return true for Android Studio project', function () {
+        var root = path.join(__dirname, '../fixtures/android_studio_project/');
+        var isAndStud = AndroidStudio.isAndroidStudioProject(root);
+        expect(isAndStud).toBe(true);
     });
-    it('should return false non Android Studio project', function() {
-      var root = path.join(__dirname,'../fixtures/android_project/');
-      var isAndStud = AndroidStudio.isAndroidStudioProject(root);
-      expect(isAndStud).toBe(false);
+    it('should return false non Android Studio project', function () {
+        var root = path.join(__dirname, '../fixtures/android_project/');
+        var isAndStud = AndroidStudio.isAndroidStudioProject(root);
+        expect(isAndStud).toBe(false);
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/Api.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/Api.spec.js b/spec/unit/Api.spec.js
index 83f801e..68f6851 100644
--- a/spec/unit/Api.spec.js
+++ b/spec/unit/Api.spec.js
@@ -18,6 +18,7 @@
 */
 
 /* jshint node:true */
+/* eslint-env jasmine */
 
 var Q = require('q');
 var os = require('os');
@@ -37,7 +38,7 @@ describe('addPlugin method', function () {
     var api, fail, gradleBuilder, oldClean;
     var Api = rewire('../../bin/templates/cordova/Api');
 
-    beforeEach(function() {
+    beforeEach(function () {
         var pluginManager = jasmine.createSpyObj('pluginManager', ['addPlugin']);
         pluginManager.addPlugin.and.returnValue(Q());
         spyOn(common.PluginManager, 'get').and.returnValue(pluginManager);
@@ -58,20 +59,16 @@ describe('addPlugin method', function () {
         Api.__set__('Api.prototype.clean', oldClean);
     });
 
-    it('Test#001 : should call gradleBuilder.prepBuildFiles for every plugin with frameworks', function(done) {
-        api.addPlugin(new PluginInfo(path.join(FIXTURES, 'cordova-plugin-fake')))
-        .catch(fail)
-        .fin(function () {
+    it('Test#001 : should call gradleBuilder.prepBuildFiles for every plugin with frameworks', function (done) {
+        api.addPlugin(new PluginInfo(path.join(FIXTURES, 'cordova-plugin-fake'))).catch(fail).fin(function () {
             expect(fail).not.toHaveBeenCalled();
             expect(gradleBuilder.prepBuildFiles).toHaveBeenCalled();
             done();
         });
     });
 
-    it('Test#002 : shouldn\'t trigger gradleBuilder.prepBuildFiles for plugins without android frameworks', function(done) {
-        api.addPlugin(new PluginInfo(path.join(FIXTURES, 'cordova-plugin-fake-ios-frameworks')))
-        .catch(fail)
-        .fin(function () {
+    it('Test#002 : shouldn\'t trigger gradleBuilder.prepBuildFiles for plugins without android frameworks', function (done) {
+        api.addPlugin(new PluginInfo(path.join(FIXTURES, 'cordova-plugin-fake-ios-frameworks'))).catch(fail).fin(function () {
             expect(fail).not.toHaveBeenCalled();
             expect(gradleBuilder.prepBuildFiles).not.toHaveBeenCalled();
             done();

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/android_sdk.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/android_sdk.spec.js b/spec/unit/android_sdk.spec.js
index 04322ce..ec0e9cd 100644
--- a/spec/unit/android_sdk.spec.js
+++ b/spec/unit/android_sdk.spec.js
@@ -17,114 +17,108 @@
     under the License.
 */
 /* jshint laxcomma:true */
+/* eslint-env jasmine */
 
-var android_sdk = require("../../bin/templates/cordova/lib/android_sdk");
-var superspawn = require("cordova-common").superspawn;
-var fs = require("fs");
-var path = require("path");
-var Q = require("q");
+var android_sdk = require('../../bin/templates/cordova/lib/android_sdk');
+var superspawn = require('cordova-common').superspawn;
+var fs = require('fs');
+var path = require('path');
+var Q = require('q');
 
-describe("android_sdk", function () {
-    describe("list_targets_with_android", function() {
-        it("should invoke `android` with the `list target` command and _not_ the `list targets` command, as the plural form is not supported in some Android SDK Tools versions", function() {
+describe('android_sdk', function () {
+    describe('list_targets_with_android', function () {
+        it('should invoke `android` with the `list target` command and _not_ the `list targets` command, as the plural form is not supported in some Android SDK Tools versions', function () {
             var deferred = Q.defer();
-            spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
+            spyOn(superspawn, 'spawn').and.returnValue(deferred.promise);
             android_sdk.list_targets_with_android();
-            expect(superspawn.spawn).toHaveBeenCalledWith("android", ["list", "target"]);
+            expect(superspawn.spawn).toHaveBeenCalledWith('android', ['list', 'target']);
         });
-        it("should parse and return results from `android list targets` command", function(done) {
+        it('should parse and return results from `android list targets` command', function (done) {
             var deferred = Q.defer();
-            spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
-            deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.2-android_list_targets.txt"), "utf-8"));
-            return android_sdk.list_targets_with_android()
-            .then(function(list) {
-                [ "Google Inc.:Google APIs:23",
-                  "Google Inc.:Google APIs:22",
-                  "Google Inc.:Google APIs:21",
-                  "android-25",
-                  "android-24",
-                  "android-N",
-                  "android-23",
-                  "android-MNC",
-                  "android-22",
-                  "android-21",
-                  "android-20" ].forEach(function(target) {
-                    expect(list).toContain(target);
-                  });
-            }).fail(function(err) {
+            spyOn(superspawn, 'spawn').and.returnValue(deferred.promise);
+            deferred.resolve(fs.readFileSync(path.join('spec', 'fixtures', 'sdk25.2-android_list_targets.txt'), 'utf-8'));
+            return android_sdk.list_targets_with_android().then(function (list) {
+                [ 'Google Inc.:Google APIs:23',
+                    'Google Inc.:Google APIs:22',
+                    'Google Inc.:Google APIs:21',
+                    'android-25',
+                    'android-24',
+                    'android-N',
+                    'android-23',
+                    'android-MNC',
+                    'android-22',
+                    'android-21',
+                    'android-20' ].forEach(function (target) { expect(list).toContain(target); });
+            }).fail(function (err) {
                 console.log(err);
                 expect(err).toBeUndefined();
-            }).fin(function() {
+            }).fin(function () {
                 done();
             });
         });
     });
-    describe("list_targets_with_avdmanager", function() {
-        it("should parse and return results from `avdmanager list target` command", function(done) {
+    describe('list_targets_with_avdmanager', function () {
+        it('should parse and return results from `avdmanager list target` command', function (done) {
             var deferred = Q.defer();
-            spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
-            deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.3-avdmanager_list_target.txt"), "utf-8"));
-            return android_sdk.list_targets_with_avdmanager()
-            .then(function(list) {
-                expect(list).toContain("android-25");
-            }).fail(function(err) {
+            spyOn(superspawn, 'spawn').and.returnValue(deferred.promise);
+            deferred.resolve(fs.readFileSync(path.join('spec', 'fixtures', 'sdk25.3-avdmanager_list_target.txt'), 'utf-8'));
+            return android_sdk.list_targets_with_avdmanager().then(function (list) {
+                expect(list).toContain('android-25');
+            }).fail(function (err) {
                 console.log(err);
                 expect(err).toBeUndefined();
-            }).fin(function() {
+            }).fin(function () {
                 done();
             });
         });
     });
-    describe("list_targets", function() {
-        it("should parse Android SDK installed target information with `avdmanager` command first", function() {
+    describe('list_targets', function () {
+        it('should parse Android SDK installed target information with `avdmanager` command first', function () {
             var deferred = Q.defer();
-            var avdmanager_spy = spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
+            var avdmanager_spy = spyOn(android_sdk, 'list_targets_with_avdmanager').and.returnValue(deferred.promise);
             android_sdk.list_targets();
             expect(avdmanager_spy).toHaveBeenCalled();
         });
-        it("should parse Android SDK installed target information with `android` command if list_targets_with_avdmanager fails with ENOENT", function(done) {
+        it('should parse Android SDK installed target information with `android` command if list_targets_with_avdmanager fails with ENOENT', function (done) {
             var deferred = Q.defer();
-            spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
+            spyOn(android_sdk, 'list_targets_with_avdmanager').and.returnValue(deferred.promise);
             deferred.reject({
-                code: "ENOENT"
+                code: 'ENOENT'
             });
             var twoferred = Q.defer();
-            twoferred.resolve(["target1"]);
-            var avdmanager_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(twoferred.promise);
-            return android_sdk.list_targets()
-            .then(function(targets) {
+            twoferred.resolve(['target1']);
+            var avdmanager_spy = spyOn(android_sdk, 'list_targets_with_android').and.returnValue(twoferred.promise);
+            return android_sdk.list_targets().then(function (targets) {
                 expect(avdmanager_spy).toHaveBeenCalled();
-                expect(targets[0]).toEqual("target1");
+                expect(targets[0]).toEqual('target1');
                 done();
             });
         });
-        it("should parse Android SDK installed target information with `android` command if list_targets_with_avdmanager fails with not-recognized error (Windows)", function(done) {
+        it('should parse Android SDK installed target information with `android` command if list_targets_with_avdmanager fails with not-recognized error (Windows)', function (done) {
             var deferred = Q.defer();
-            spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
+            spyOn(android_sdk, 'list_targets_with_avdmanager').and.returnValue(deferred.promise);
             deferred.reject({
                 code: 1,
                 stderr: "'avdmanager' is not recognized as an internal or external commmand,\r\noperable program or batch file.\r\n"
             });
             var twoferred = Q.defer();
-            twoferred.resolve(["target1"]);
-            var avdmanager_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(twoferred.promise);
-            return android_sdk.list_targets()
-            .then(function(targets) {
+            twoferred.resolve(['target1']);
+            var avdmanager_spy = spyOn(android_sdk, 'list_targets_with_android').and.returnValue(twoferred.promise);
+            return android_sdk.list_targets().then(function (targets) {
                 expect(avdmanager_spy).toHaveBeenCalled();
-                expect(targets[0]).toEqual("target1");
+                expect(targets[0]).toEqual('target1');
                 done();
             });
         });
-        it("should throw an error if no Android targets were found.", function(done) {
+        it('should throw an error if no Android targets were found.', function (done) {
             var deferred = Q.defer();
-            spyOn(android_sdk, "list_targets_with_avdmanager").and.returnValue(deferred.promise);
+            spyOn(android_sdk, 'list_targets_with_avdmanager').and.returnValue(deferred.promise);
             deferred.resolve([]);
-            return android_sdk.list_targets()
-            .then(function(targets) {
+            return android_sdk.list_targets().then(function (targets) {
                 done.fail();
-            }).catch(function(err) {
+            }).catch(function (err) {
                 expect(err).toBeDefined();
-                expect(err.message).toContain("No android targets (SDKs) installed!");
+                expect(err.message).toContain('No android targets (SDKs) installed!');
                 done();
             });
         });

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/builders/GradleBuilder.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/builders/GradleBuilder.spec.js b/spec/unit/builders/GradleBuilder.spec.js
index 28652bd..559cb35 100644
--- a/spec/unit/builders/GradleBuilder.spec.js
+++ b/spec/unit/builders/GradleBuilder.spec.js
@@ -1,22 +1,23 @@
-var gradle_builder = require('../../../bin/templates/cordova/lib/builders/GradleBuilder.js');
+/* eslint-env jasmine */
+var Gradle_builder = require('../../../bin/templates/cordova/lib/builders/GradleBuilder.js');
 var fs = require('fs');
 var superspawn = require('cordova-common').superspawn;
 var builder;
 
-describe('Gradle Builder', function() {
-    beforeEach(function() {
+describe('Gradle Builder', function () {
+    beforeEach(function () {
         spyOn(fs, 'existsSync').and.returnValue(true);
-        builder = new gradle_builder('/root');
+        builder = new Gradle_builder('/root');
         spyOn(superspawn, 'spawn');
     });
 
-    describe('runGradleWrapper method', function() {
-        it('should run the provided gradle command if a gradle wrapper does not already exist', function() {
+    describe('runGradleWrapper method', function () {
+        it('should run the provided gradle command if a gradle wrapper does not already exist', function () {
             fs.existsSync.and.returnValue(false);
             builder.runGradleWrapper('/my/sweet/gradle');
             expect(superspawn.spawn).toHaveBeenCalledWith('/my/sweet/gradle', jasmine.any(Array), jasmine.any(Object));
         });
-        it('should do nothing if a gradle wrapper exists in the project directory', function() {
+        it('should do nothing if a gradle wrapper exists in the project directory', function () {
             fs.existsSync.and.returnValue(true);
             builder.runGradleWrapper('/my/sweet/gradle');
             expect(superspawn.spawn).not.toHaveBeenCalledWith('/my/sweet/gradle', jasmine.any(Array), jasmine.any(Object));

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/check_reqs.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/check_reqs.spec.js b/spec/unit/check_reqs.spec.js
index 971d3a6..0917443 100644
--- a/spec/unit/check_reqs.spec.js
+++ b/spec/unit/check_reqs.spec.js
@@ -17,233 +17,223 @@
     under the License.
 */
 /* jshint laxcomma:true */
+/* eslint-env jasmine */
 
-var check_reqs = require("../../bin/templates/cordova/lib/check_reqs");
-var android_sdk = require("../../bin/templates/cordova/lib/android_sdk");
-var shelljs = require("shelljs");
-var fs = require("fs");
-var path = require("path");
-var Q = require("q");
+var check_reqs = require('../../bin/templates/cordova/lib/check_reqs');
+var android_sdk = require('../../bin/templates/cordova/lib/android_sdk');
+var shelljs = require('shelljs');
+var fs = require('fs');
+var path = require('path');
+var Q = require('q');
 
-describe("check_reqs", function () {
+describe('check_reqs', function () {
     var original_env;
-    beforeAll(function() {
+    beforeAll(function () {
         original_env = Object.create(process.env);
     });
-    afterEach(function() {
-        Object.keys(original_env).forEach(function(k) {
+    afterEach(function () {
+        Object.keys(original_env).forEach(function (k) {
             process.env[k] = original_env[k];
         });
     });
-    describe("check_android", function() {
-        describe("set ANDROID_HOME if not set", function() {
-            beforeEach(function() {
+    describe('check_android', function () {
+        describe('set ANDROID_HOME if not set', function () {
+            beforeEach(function () {
                 delete process.env.ANDROID_HOME;
             });
-            describe("even if no Android binaries are on the PATH", function() {
-                beforeEach(function() {
-                    spyOn(shelljs, "which").and.returnValue(null);
-                    spyOn(fs, "existsSync").and.returnValue(true);
+            describe('even if no Android binaries are on the PATH', function () {
+                beforeEach(function () {
+                    spyOn(shelljs, 'which').and.returnValue(null);
+                    spyOn(fs, 'existsSync').and.returnValue(true);
                 });
-                it("it should set ANDROID_HOME on Windows", function(done) {
-                    spyOn(check_reqs, "isWindows").and.returnValue(true);
-                    process.env.LOCALAPPDATA = "windows-local-app-data";
-                    process.env.ProgramFiles = "windows-program-files";
-                    return check_reqs.check_android()
-                    .then(function() {
-                        expect(process.env.ANDROID_HOME).toContain("windows-local-app-data");
-                    }).fail(function(err) {
+                it('it should set ANDROID_HOME on Windows', function (done) {
+                    spyOn(check_reqs, 'isWindows').and.returnValue(true);
+                    process.env.LOCALAPPDATA = 'windows-local-app-data';
+                    process.env.ProgramFiles = 'windows-program-files';
+                    return check_reqs.check_android().then(function () {
+                        expect(process.env.ANDROID_HOME).toContain('windows-local-app-data');
+                    }).fail(function (err) {
                         expect(err).toBeUndefined();
                         console.log(err);
-                    }).fin(function() {
+                    }).fin(function () {
                         delete process.env.LOCALAPPDATA;
                         delete process.env.ProgramFiles;
                         done();
                     });
                 });
-                it("it should set ANDROID_HOME on Darwin", function(done) {
-                    spyOn(check_reqs, "isWindows").and.returnValue(false);
-                    spyOn(check_reqs, "isDarwin").and.returnValue(true);
-                    process.env.HOME = "home is where the heart is";
-                    return check_reqs.check_android()
-                    .then(function() {
-                        expect(process.env.ANDROID_HOME).toContain("home is where the heart is");
-                    }).fail(function(err) {
+                it('it should set ANDROID_HOME on Darwin', function (done) {
+                    spyOn(check_reqs, 'isWindows').and.returnValue(false);
+                    spyOn(check_reqs, 'isDarwin').and.returnValue(true);
+                    process.env.HOME = 'home is where the heart is';
+                    return check_reqs.check_android().then(function () {
+                        expect(process.env.ANDROID_HOME).toContain('home is where the heart is');
+                    }).fail(function (err) {
                         expect(err).toBeUndefined();
                         console.log(err);
-                    }).fin(function() {
+                    }).fin(function () {
                         delete process.env.HOME;
                         done();
                     });
                 });
             });
-            describe("if some Android tooling exists on the PATH", function() {
-                beforeEach(function() {
-                    spyOn(fs, "realpathSync").and.callFake(function(path) {
+            describe('if some Android tooling exists on the PATH', function () {
+                beforeEach(function () {
+                    spyOn(fs, 'realpathSync').and.callFake(function (path) {
                         return path;
                     });
                 });
-                it("should set ANDROID_HOME based on `android` command if command exists in a SDK-like directory structure", function(done) {
-                    spyOn(fs, "existsSync").and.returnValue(true);
-                    spyOn(shelljs, "which").and.callFake(function(cmd) {
-                        if (cmd == "android") {
-                            return "/android/sdk/tools/android";
+                it('should set ANDROID_HOME based on `android` command if command exists in a SDK-like directory structure', function (done) {
+                    spyOn(fs, 'existsSync').and.returnValue(true);
+                    spyOn(shelljs, 'which').and.callFake(function (cmd) {
+                        if (cmd === 'android') {
+                            return '/android/sdk/tools/android';
                         } else {
                             return null;
                         }
                     });
-                    return check_reqs.check_android()
-                    .then(function() {
-                        expect(process.env.ANDROID_HOME).toEqual("/android/sdk");
+                    return check_reqs.check_android().then(function () {
+                        expect(process.env.ANDROID_HOME).toEqual('/android/sdk');
                         done();
-                    }).fail(function(err) {
+                    }).fail(function (err) {
                         expect(err).toBeUndefined();
                         console.log(err);
                     });
                 });
-                it("should error out if `android` command exists in a non-SDK-like directory structure", function(done) {
-                    spyOn(shelljs, "which").and.callFake(function(cmd) {
-                        if (cmd == "android") {
-                            return "/just/some/random/path/android";
+                it('should error out if `android` command exists in a non-SDK-like directory structure', function (done) {
+                    spyOn(shelljs, 'which').and.callFake(function (cmd) {
+                        if (cmd === 'android') {
+                            return '/just/some/random/path/android';
                         } else {
                             return null;
                         }
                     });
-                    return check_reqs.check_android()
-                    .then(function() {
+                    return check_reqs.check_android().then(function () {
                         done.fail();
-                    }).fail(function(err) {
+                    }).fail(function (err) {
                         expect(err).toBeDefined();
-                        expect(err.message).toContain("update your PATH to include valid path");
+                        expect(err.message).toContain('update your PATH to include valid path');
                         done();
                     });
                 });
-                it("should set ANDROID_HOME based on `adb` command if command exists in a SDK-like directory structure", function(done) {
-                    spyOn(fs, "existsSync").and.returnValue(true);
-                    spyOn(shelljs, "which").and.callFake(function(cmd) {
-                        if (cmd == "adb") {
-                            return "/android/sdk/platform-tools/adb";
+                it('should set ANDROID_HOME based on `adb` command if command exists in a SDK-like directory structure', function (done) {
+                    spyOn(fs, 'existsSync').and.returnValue(true);
+                    spyOn(shelljs, 'which').and.callFake(function (cmd) {
+                        if (cmd === 'adb') {
+                            return '/android/sdk/platform-tools/adb';
                         } else {
                             return null;
                         }
                     });
-                    return check_reqs.check_android()
-                    .then(function() {
-                        expect(process.env.ANDROID_HOME).toEqual("/android/sdk");
+                    return check_reqs.check_android().then(function () {
+                        expect(process.env.ANDROID_HOME).toEqual('/android/sdk');
                         done();
-                    }).fail(function(err) {
+                    }).fail(function (err) {
                         expect(err).toBeUndefined();
                         console.log(err);
                     });
                 });
-                it("should error out if `adb` command exists in a non-SDK-like directory structure", function(done) {
-                    spyOn(shelljs, "which").and.callFake(function(cmd) {
-                        if (cmd == "adb") {
-                            return "/just/some/random/path/adb";
+                it('should error out if `adb` command exists in a non-SDK-like directory structure', function (done) {
+                    spyOn(shelljs, 'which').and.callFake(function (cmd) {
+                        if (cmd === 'adb') {
+                            return '/just/some/random/path/adb';
                         } else {
                             return null;
                         }
                     });
-                    return check_reqs.check_android()
-                    .then(function() {
+                    return check_reqs.check_android().then(function () {
                         done.fail();
-                    }).fail(function(err) {
+                    }).fail(function (err) {
                         expect(err).toBeDefined();
-                        expect(err.message).toContain("update your PATH to include valid path");
+                        expect(err.message).toContain('update your PATH to include valid path');
                         done();
                     });
                 });
-                it("should set ANDROID_HOME based on `avdmanager` command if command exists in a SDK-like directory structure", function(done) {
-                    spyOn(fs, "existsSync").and.returnValue(true);
-                    spyOn(shelljs, "which").and.callFake(function(cmd) {
-                        if (cmd == "avdmanager") {
-                            return "/android/sdk/tools/bin/avdmanager";
+                it('should set ANDROID_HOME based on `avdmanager` command if command exists in a SDK-like directory structure', function (done) {
+                    spyOn(fs, 'existsSync').and.returnValue(true);
+                    spyOn(shelljs, 'which').and.callFake(function (cmd) {
+                        if (cmd === 'avdmanager') {
+                            return '/android/sdk/tools/bin/avdmanager';
                         } else {
                             return null;
                         }
                     });
-                    return check_reqs.check_android()
-                    .then(function() {
-                        expect(process.env.ANDROID_HOME).toEqual("/android/sdk");
+                    return check_reqs.check_android().then(function () {
+                        expect(process.env.ANDROID_HOME).toEqual('/android/sdk');
                         done();
-                    }).fail(function(err) {
+                    }).fail(function (err) {
                         expect(err).toBeUndefined();
                         console.log(err);
                     });
                 });
-                it("should error out if `avdmanager` command exists in a non-SDK-like directory structure", function(done) {
-                    spyOn(shelljs, "which").and.callFake(function(cmd) {
-                        if (cmd == "avdmanager") {
-                            return "/just/some/random/path/avdmanager";
+                it('should error out if `avdmanager` command exists in a non-SDK-like directory structure', function (done) {
+                    spyOn(shelljs, 'which').and.callFake(function (cmd) {
+                        if (cmd === 'avdmanager') {
+                            return '/just/some/random/path/avdmanager';
                         } else {
                             return null;
                         }
                     });
-                    return check_reqs.check_android()
-                    .then(function() {
+                    return check_reqs.check_android().then(function () {
                         done.fail();
-                    }).fail(function(err) {
+                    }).fail(function (err) {
                         expect(err).toBeDefined();
-                        expect(err.message).toContain("update your PATH to include valid path");
+                        expect(err.message).toContain('update your PATH to include valid path');
                         done();
                     });
                 });
             });
         });
-        describe("set PATH for various Android binaries if not available", function() {
-            beforeEach(function() {
-                spyOn(shelljs, "which").and.returnValue(null);
-                process.env.ANDROID_HOME = "let the children play";
-                spyOn(fs, "existsSync").and.returnValue(true);
+        describe('set PATH for various Android binaries if not available', function () {
+            beforeEach(function () {
+                spyOn(shelljs, 'which').and.returnValue(null);
+                process.env.ANDROID_HOME = 'let the children play';
+                spyOn(fs, 'existsSync').and.returnValue(true);
             });
-            afterEach(function() {
+            afterEach(function () {
                 delete process.env.ANDROID_HOME;
             });
-            it("should add tools/bin,tools,platform-tools to PATH if `avdmanager`,`android`,`adb` is not found", function(done) {
-                return check_reqs.check_android()
-                .then(function() {
-                    expect(process.env.PATH).toContain("let the children play" + path.sep + "tools");
-                    expect(process.env.PATH).toContain("let the children play" + path.sep + "platform-tools");
-                    expect(process.env.PATH).toContain("let the children play" + path.sep + "tools" + path.sep + "bin");
+            it('should add tools/bin,tools,platform-tools to PATH if `avdmanager`,`android`,`adb` is not found', function (done) {
+                return check_reqs.check_android().then(function () {
+                    expect(process.env.PATH).toContain('let the children play' + path.sep + 'tools');
+                    expect(process.env.PATH).toContain('let the children play' + path.sep + 'platform-tools');
+                    expect(process.env.PATH).toContain('let the children play' + path.sep + 'tools' + path.sep + 'bin');
                     done();
-                }).fail(function(err) {
+                }).fail(function (err) {
                     expect(err).toBeUndefined();
                     console.log(err);
                 });
             });
         });
     });
-    describe("get_target", function() {
-        it("should retrieve target from framework project.properties file", function() {
+    describe('get_target', function () {
+        it('should retrieve target from framework project.properties file', function () {
             var target = check_reqs.get_target();
             expect(target).toBeDefined();
-            expect(target).toContain("android-");
+            expect(target).toContain('android-');
         });
     });
-    describe("check_android_target", function() {
-        it("should should return full list of supported targets if there is a match to ideal api level", function(done) {
+    describe('check_android_target', function () {
+        it('should should return full list of supported targets if there is a match to ideal api level', function (done) {
             var deferred = Q.defer();
-            spyOn(android_sdk, "list_targets").and.returnValue(deferred.promise);
-            var fake_targets = ["you are my fire", "my one desire"];
+            spyOn(android_sdk, 'list_targets').and.returnValue(deferred.promise);
+            var fake_targets = ['you are my fire', 'my one desire'];
             deferred.resolve(fake_targets);
-            spyOn(check_reqs, "get_target").and.returnValue("you are my fire");
-            return check_reqs.check_android_target()
-            .then(function(targets) {
+            spyOn(check_reqs, 'get_target').and.returnValue('you are my fire');
+            return check_reqs.check_android_target().then(function (targets) {
                 expect(targets).toBeDefined();
                 expect(targets).toEqual(fake_targets);
                 done();
             });
         });
-        it("should error out if there is no match between ideal api level and installed targets", function(done) {
+        it('should error out if there is no match between ideal api level and installed targets', function (done) {
             var deferred = Q.defer();
-            spyOn(android_sdk, "list_targets").and.returnValue(deferred.promise);
-            var fake_targets = ["you are my fire", "my one desire"];
+            spyOn(android_sdk, 'list_targets').and.returnValue(deferred.promise);
+            var fake_targets = ['you are my fire', 'my one desire'];
             deferred.resolve(fake_targets);
-            spyOn(check_reqs, "get_target").and.returnValue("and i knowwwwwwwwwwww");
-            return check_reqs.check_android_target()
-            .catch(function(err) {
+            spyOn(check_reqs, 'get_target').and.returnValue('and i knowwwwwwwwwwww');
+            return check_reqs.check_android_target().catch(function (err) {
                 expect(err).toBeDefined();
-                expect(err.message).toContain("Please install Android target");
+                expect(err.message).toContain('Please install Android target');
                 done();
             });
         });

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/create.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/create.spec.js b/spec/unit/create.spec.js
index 1b010dc..98891e8 100644
--- a/spec/unit/create.spec.js
+++ b/spec/unit/create.spec.js
@@ -17,96 +17,92 @@
     under the License.
 */
 /* jshint laxcomma:true */
+/* eslint-env jasmine */
 
-var create = require("../../bin/lib/create");
+var create = require('../../bin/lib/create');
 
-describe("create", function () {
-  describe("validatePackageName", function() {
-    var valid = [
-        "org.apache.mobilespec"
-      , "com.example"
-      , "com.floors42.package"
-      , "ball8.ball8.ball8ball"
-    ];
-    var invalid = [
-        ""
-      , "com.class.is.bad"
-      , "0com.example.mobilespec"
-      , "c-m.e@a!p%e.mobilespec"
-      , "notenoughdots"
-      , ".starts.with.a.dot"
-      , "ends.with.a.dot."
-      , "_underscore.anything"
-      , "underscore._something"
-      , "_underscore._all._the._things"
-      , "8.ball"
-      , "8ball.ball"
-      , "ball8.8ball"
-      , "ball8.com.8ball"
-    ];
+describe('create', function () {
+    describe('validatePackageName', function () {
+        var valid = [
+            'org.apache.mobilespec',
+            'com.example',
+            'com.floors42.package',
+            'ball8.ball8.ball8ball'
+        ];
+        var invalid = [
+            '',
+            'com.class.is.bad',
+            '0com.example.mobilespec',
+            'c-m.e@a!p%e.mobilespec',
+            'notenoughdots',
+            '.starts.with.a.dot',
+            'ends.with.a.dot.',
+            '_underscore.anything',
+            'underscore._something',
+            '_underscore._all._the._things',
+            '8.ball',
+            '8ball.ball',
+            'ball8.8ball',
+            'ball8.com.8ball'
+        ];
 
-    valid.forEach(function(package_name) {
-      it("Test#001 : should accept " + package_name, function(done) {
-        return create.validatePackageName(package_name)
-        .then(function() {
-          //resolved
-          done();
-        }).fail(function(err) {
-          expect(err).toBeUndefined();
+        valid.forEach(function (package_name) {
+            it('Test#001 : should accept ' + package_name, function (done) {
+                return create.validatePackageName(package_name).then(function () {
+                // resolved
+                    done();
+                }).fail(function (err) {
+                    expect(err).toBeUndefined();
+                });
+            });
         });
-      });
-    });
 
-    invalid.forEach(function(package_name) {
-      it("Test#002 : should reject " + package_name, function(done) {
-        return create.validatePackageName(package_name)
-        .then(function() {
-          //shouldn't be here
-          expect(true).toBe(false);
-        }).fail(function(err) {
-          expect(err).toBeDefined();
-          done();
+        invalid.forEach(function (package_name) {
+            it('Test#002 : should reject ' + package_name, function (done) {
+                return create.validatePackageName(package_name).then(function () {
+                    // shouldn't be here
+                    expect(true).toBe(false);
+                }).fail(function (err) {
+                    expect(err).toBeDefined();
+                    done();
+                });
+            });
         });
-      });
     });
-  });
-  describe("validateProjectName", function() {
-    var valid = [
-        "mobilespec"
-      , "package_name"
-      , "PackageName"
-      , "CordovaLib"
-    ];
-    var invalid = [
-        ""
-      , "0startswithdigit"
-      , "CordovaActivity"
-    ];
+    describe('validateProjectName', function () {
+        var valid = [
+            'mobilespec',
+            'package_name',
+            'PackageName',
+            'CordovaLib'
+        ];
+        var invalid = [
+            '',
+            '0startswithdigit',
+            'CordovaActivity'
+        ];
 
-    valid.forEach(function(project_name) {
-      it("Test#003 : should accept " + project_name, function(done) {
-        return create.validateProjectName(project_name)
-        .then(function() {
-          //resolved
-          done();
-        }).fail(function(err) {
-          expect(err).toBeUndefined();
+        valid.forEach(function (project_name) {
+            it('Test#003 : should accept ' + project_name, function (done) {
+                return create.validateProjectName(project_name).then(function () {
+                    // resolved
+                    done();
+                }).fail(function (err) {
+                    expect(err).toBeUndefined();
+                });
+            });
         });
-      });
-    });
 
-    invalid.forEach(function(project_name) {
-      it("Test#004 : should reject " + project_name, function(done) {
-        return create.validateProjectName(project_name)
-        .then(function() {
-          //shouldn't be here
-          expect(true).toBe(false);
-        }).fail(function(err) {
-          expect(err).toBeDefined();
-          done();
+        invalid.forEach(function (project_name) {
+            it('Test#004 : should reject ' + project_name, function (done) {
+                return create.validateProjectName(project_name).then(function () {
+                    // shouldn't be here
+                    expect(true).toBe(false);
+                }).fail(function (err) {
+                    expect(err).toBeDefined();
+                    done();
+                });
+            });
         });
-      });
     });
-  });
 });
-

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/emulator.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/emulator.spec.js b/spec/unit/emulator.spec.js
index 8aef5ef..490d0a1 100644
--- a/spec/unit/emulator.spec.js
+++ b/spec/unit/emulator.spec.js
@@ -16,96 +16,95 @@
     specific language governing permissions and limitations
     under the License.
 */
-var emu = require("../../bin/templates/cordova/lib/emulator");
-var superspawn = require("cordova-common").superspawn;
-var Q = require("q");
-var fs = require("fs");
-var path = require("path");
-var shelljs = require("shelljs");
+/* eslint-env jasmine */
 
-describe("emulator", function () {
-    describe("list_images_using_avdmanager", function() {
-        it("should properly parse details of SDK Tools 25.3.1 `avdmanager` output", function(done) {
+var emu = require('../../bin/templates/cordova/lib/emulator');
+var superspawn = require('cordova-common').superspawn;
+var Q = require('q');
+var fs = require('fs');
+var path = require('path');
+var shelljs = require('shelljs');
+
+describe('emulator', function () {
+    describe('list_images_using_avdmanager', function () {
+        it('should properly parse details of SDK Tools 25.3.1 `avdmanager` output', function (done) {
             var deferred = Q.defer();
-            spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
-            deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.3-avdmanager_list_avd.txt"), "utf-8"));
-            return emu.list_images_using_avdmanager()
-            .then(function(list) {
+            spyOn(superspawn, 'spawn').and.returnValue(deferred.promise);
+            deferred.resolve(fs.readFileSync(path.join('spec', 'fixtures', 'sdk25.3-avdmanager_list_avd.txt'), 'utf-8'));
+            return emu.list_images_using_avdmanager().then(function (list) {
                 expect(list).toBeDefined();
-                expect(list[0].name).toEqual("nexus5-5.1");
-                expect(list[0].target).toEqual("Android 5.1 (API level 22)");
-                expect(list[1].device).toEqual("pixel (Google)");
-                expect(list[2].abi).toEqual("default/x86_64");
-            }).fail(function(err) {
+                expect(list[0].name).toEqual('nexus5-5.1');
+                expect(list[0].target).toEqual('Android 5.1 (API level 22)');
+                expect(list[1].device).toEqual('pixel (Google)');
+                expect(list[2].abi).toEqual('default/x86_64');
+            }).fail(function (err) {
                 expect(err).toBeUndefined();
-            }).fin(function() {
+            }).fin(function () {
                 done();
             });
         });
     });
-    describe("list_images_using_android", function() {
-        it("should invoke `android` with the `list avd` command and _not_ the `list avds` command, as the plural form is not supported in some Android SDK Tools versions", function() {
+    describe('list_images_using_android', function () {
+        it('should invoke `android` with the `list avd` command and _not_ the `list avds` command, as the plural form is not supported in some Android SDK Tools versions', function () {
             var deferred = Q.defer();
-            spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
+            spyOn(superspawn, 'spawn').and.returnValue(deferred.promise);
             emu.list_images_using_android();
-            expect(superspawn.spawn).toHaveBeenCalledWith("android", ["list", "avd"]);
+            expect(superspawn.spawn).toHaveBeenCalledWith('android', ['list', 'avd']);
         });
-        it("should properly parse details of SDK Tools pre-25.3.1 `android list avd` output", function(done) {
+        it('should properly parse details of SDK Tools pre-25.3.1 `android list avd` output', function (done) {
             var deferred = Q.defer();
-            spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
-            deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdk25.2-android_list_avd.txt"), "utf-8"));
-            return emu.list_images_using_android()
-            .then(function(list) {
+            spyOn(superspawn, 'spawn').and.returnValue(deferred.promise);
+            deferred.resolve(fs.readFileSync(path.join('spec', 'fixtures', 'sdk25.2-android_list_avd.txt'), 'utf-8'));
+            return emu.list_images_using_android().then(function (list) {
                 expect(list).toBeDefined();
-                expect(list[0].name).toEqual("QWR");
-                expect(list[0].device).toEqual("Nexus 5 (Google)");
-                expect(list[0].path).toEqual("/Users/shazron/.android/avd/QWR.avd");
-                expect(list[0].target).toEqual("Android 7.1.1 (API level 25)");
-                expect(list[0].abi).toEqual("google_apis/x86_64");
-                expect(list[0].skin).toEqual("1080x1920");
-            }).fail(function(err) {
+                expect(list[0].name).toEqual('QWR');
+                expect(list[0].device).toEqual('Nexus 5 (Google)');
+                expect(list[0].path).toEqual('/Users/shazron/.android/avd/QWR.avd');
+                expect(list[0].target).toEqual('Android 7.1.1 (API level 25)');
+                expect(list[0].abi).toEqual('google_apis/x86_64');
+                expect(list[0].skin).toEqual('1080x1920');
+            }).fail(function (err) {
                 expect(err).toBeUndefined();
-            }).fin(function() {
+            }).fin(function () {
                 done();
             });
         });
     });
-    describe("list_images", function() {
-        beforeEach(function() {
-            spyOn(fs, "realpathSync").and.callFake(function(cmd) {
+    describe('list_images', function () {
+        beforeEach(function () {
+            spyOn(fs, 'realpathSync').and.callFake(function (cmd) {
                 return cmd;
             });
         });
-        it("should try to parse AVD information using `avdmanager` first", function() {
-            spyOn(shelljs, "which").and.callFake(function(cmd) {
-                if (cmd == "avdmanager") {
+        it('should try to parse AVD information using `avdmanager` first', function () {
+            spyOn(shelljs, 'which').and.callFake(function (cmd) {
+                if (cmd === 'avdmanager') {
                     return true;
                 } else {
                     return false;
                 }
             });
-            var avdmanager_spy = spyOn(emu, "list_images_using_avdmanager").and.returnValue({catch:function(){}});
+            var avdmanager_spy = spyOn(emu, 'list_images_using_avdmanager').and.returnValue({catch: function () {}});
             emu.list_images();
             expect(avdmanager_spy).toHaveBeenCalled();
         });
-        it("should delegate to `android` if `avdmanager` cant be found and `android` can", function() {
-            spyOn(shelljs, "which").and.callFake(function(cmd) {
-                if (cmd == "avdmanager") {
+        it('should delegate to `android` if `avdmanager` cant be found and `android` can', function () {
+            spyOn(shelljs, 'which').and.callFake(function (cmd) {
+                if (cmd === 'avdmanager') {
                     return false;
                 } else {
                     return true;
                 }
             });
-            var android_spy = spyOn(emu, "list_images_using_android");
+            var android_spy = spyOn(emu, 'list_images_using_android');
             emu.list_images();
             expect(android_spy).toHaveBeenCalled();
         });
-        it("should throw an error if neither `avdmanager` nor `android` are able to be found", function(done) {
-            spyOn(shelljs, "which").and.returnValue(false);
-            return emu.list_images()
-            .catch(function(err) {
+        it('should throw an error if neither `avdmanager` nor `android` are able to be found', function (done) {
+            spyOn(shelljs, 'which').and.returnValue(false);
+            return emu.list_images().catch(function (err) {
                 expect(err).toBeDefined();
-                expect(err.message).toContain("Could not find either `android` or `avdmanager`");
+                expect(err.message).toContain('Could not find either `android` or `avdmanager`');
                 done();
             });
         });

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/d83d49d8/spec/unit/pluginHandlers/common.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/pluginHandlers/common.spec.js b/spec/unit/pluginHandlers/common.spec.js
index 0a4a4b4..6850d78 100644
--- a/spec/unit/pluginHandlers/common.spec.js
+++ b/spec/unit/pluginHandlers/common.spec.js
@@ -15,6 +15,7 @@
  * under the License.
  *
 */
+/* eslint-env jasmine */
 
 var rewire = require('rewire');
 var common = rewire('../../../bin/templates/cordova/lib/pluginHandlers');
@@ -35,25 +36,25 @@ var copyFile = common.__get__('copyFile');
 var deleteJava = common.__get__('deleteJava');
 var copyNewFile = common.__get__('copyNewFile');
 
-describe('common platform handler', function() {
+describe('common platform handler', function () {
 
-    describe('copyFile', function() {
-        it('Test#001 : should throw if source path not found', function(){
+    describe('copyFile', function () {
+        it('Test#001 : should throw if source path not found', function () {
             shell.rm('-rf', src);
-            expect(function(){copyFile(test_dir, src, project_dir, dest);})
+            expect(function () { copyFile(test_dir, src, project_dir, dest); })
                 .toThrow(new Error('"' + src + '" not found!'));
         });
 
-        it('Test#002 : should throw if src not in plugin directory', function(){
+        it('Test#002 : should throw if src not in plugin directory', function () {
             shell.mkdir('-p', project_dir);
             fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
             var outside_file = '../non_plugin_file';
-            expect(function(){copyFile(test_dir, outside_file, project_dir, dest);}).
-                toThrow(new Error('File "' + path.resolve(test_dir, outside_file) + '" is located outside the plugin directory "' + test_dir + '"'));
+            expect(function () { copyFile(test_dir, outside_file, project_dir, dest); })
+                .toThrow(new Error('File "' + path.resolve(test_dir, outside_file) + '" is located outside the plugin directory "' + test_dir + '"'));
             shell.rm('-rf', test_dir);
         });
 
-        it('Test#003 : should allow symlink src, if inside plugin', function(){
+        it('Test#003 : should allow symlink src, if inside plugin', function () {
             shell.mkdir('-p', java_dir);
             fs.writeFileSync(java_file, 'contents', 'utf-8');
 
@@ -66,7 +67,7 @@ describe('common platform handler', function() {
             shell.rm('-rf', project_dir);
         });
 
-        it('Test#004 : should throw if symlink is linked to a file outside the plugin', function(){
+        it('Test#004 : should throw if symlink is linked to a file outside the plugin', function () {
             shell.mkdir('-p', java_dir);
             fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
 
@@ -75,20 +76,20 @@ describe('common platform handler', function() {
                 return;
             }
 
-            expect(function(){copyFile(test_dir, symlink_file, project_dir, dest);}).
-                toThrow(new Error('File "' + path.resolve(test_dir, symlink_file) + '" is located outside the plugin directory "' + test_dir + '"'));
+            expect(function () { copyFile(test_dir, symlink_file, project_dir, dest); })
+                .toThrow(new Error('File "' + path.resolve(test_dir, symlink_file) + '" is located outside the plugin directory "' + test_dir + '"'));
             shell.rm('-rf', project_dir);
         });
 
-        it('Test#005 : should throw if dest is outside the project directory', function(){
+        it('Test#005 : should throw if dest is outside the project directory', function () {
             shell.mkdir('-p', java_dir);
             fs.writeFileSync(java_file, 'contents', 'utf-8');
-            expect(function(){copyFile(test_dir, java_file, project_dir, non_plugin_file);}).
-                toThrow(new Error('Destination "' + path.resolve(project_dir, non_plugin_file) + '" for source file "' + path.resolve(test_dir, java_file) + '" is located outside the project'));
+            expect(function () { copyFile(test_dir, java_file, project_dir, non_plugin_file); })
+                .toThrow(new Error('Destination "' + path.resolve(project_dir, non_plugin_file) + '" for source file "' + path.resolve(test_dir, java_file) + '" is located outside the project'));
             shell.rm('-rf', project_dir);
         });
 
-        it('Test#006 : should call mkdir -p on target path', function(){
+        it('Test#006 : should call mkdir -p on target path', function () {
             shell.mkdir('-p', java_dir);
             fs.writeFileSync(java_file, 'contents', 'utf-8');
 
@@ -102,7 +103,7 @@ describe('common platform handler', function() {
             shell.rm('-rf', project_dir);
         });
 
-        it('Test#007 : should call cp source/dest paths', function(){
+        it('Test#007 : should call cp source/dest paths', function () {
             shell.mkdir('-p', java_dir);
             fs.writeFileSync(java_file, 'contents', 'utf-8');
 
@@ -119,46 +120,46 @@ describe('common platform handler', function() {
     });
 
     describe('copyNewFile', function () {
-        it('Test#008 : should throw if target path exists', function(){
+        it('Test#008 : should throw if target path exists', function () {
             shell.mkdir('-p', dest);
-            expect(function(){copyNewFile(test_dir, src, project_dir, dest);}).
-                toThrow(new Error('"' + dest + '" already exists!'));
+            expect(function () { copyNewFile(test_dir, src, project_dir, dest); })
+                .toThrow(new Error('"' + dest + '" already exists!'));
             shell.rm('-rf', dest);
         });
     });
 
-    describe('deleteJava', function() {
-        beforeEach(function() {
+    describe('deleteJava', function () {
+        beforeEach(function () {
             shell.mkdir('-p', java_dir);
             fs.writeFileSync(java_file, 'contents', 'utf-8');
         });
 
-        afterEach(function() {
+        afterEach(function () {
             shell.rm('-rf', java_dir);
         });
 
-        it('Test#009 : should call fs.unlinkSync on the provided paths', function(){
+        it('Test#009 : should call fs.unlinkSync on the provided paths', function () {
             var s = spyOn(fs, 'unlinkSync').and.callThrough();
             deleteJava(project_dir, java_file);
             expect(s).toHaveBeenCalled();
             expect(s).toHaveBeenCalledWith(path.resolve(project_dir, java_file));
         });
 
-        it('Test#010 : should delete empty directories after removing source code in a java src path hierarchy', function(){
+        it('Test#010 : should delete empty directories after removing source code in a java src path hierarchy', function () {
             deleteJava(project_dir, java_file);
             expect(fs.existsSync(java_file)).not.toBe(true);
             expect(fs.existsSync(java_dir)).not.toBe(true);
-            expect(fs.existsSync(path.join(src,'one'))).not.toBe(true);
+            expect(fs.existsSync(path.join(src, 'one'))).not.toBe(true);
         });
 
-        it('Test#011 : should never delete the top-level src directory, even if all plugins added were removed', function(){
+        it('Test#011 : should never delete the top-level src directory, even if all plugins added were removed', function () {
             deleteJava(project_dir, java_file);
             expect(fs.existsSync(src)).toBe(true);
         });
     });
 });
 
-function ignoreEPERMonWin32(symlink_src, symlink_dest) {
+function ignoreEPERMonWin32 (symlink_src, symlink_dest) {
     try {
         fs.symlinkSync(symlink_src, symlink_dest);
     } catch (e) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message