wrap conditional, because return can only be used in a function
authorZeke Sikelianos <zeke@sikelianos.com>
Fri, 25 Mar 2016 19:57:49 +0000 (12:57 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Thu, 31 Mar 2016 00:00:31 +0000 (17:00 -0700)
spec/api-auto-updater-spec.js

index efd3afe..6335f33 100644 (file)
@@ -1,38 +1,37 @@
-const assert = require('assert');
-const autoUpdater = require('electron').remote.autoUpdater;
-const ipcRenderer = require('electron').ipcRenderer;
+const assert = require('assert')
+const autoUpdater = require('electron').remote.autoUpdater
+const ipcRenderer = require('electron').ipcRenderer
 
 // Skip autoUpdater tests in MAS build.
-if (process.mas)
-  return;
+if (!process.mas) {
+  describe('autoUpdater module', function () {
+    describe('checkForUpdates', function () {
+      it('emits an error on Windows when called the feed URL is not set', function (done) {
+        if (process.platform !== 'win32') {
+          return done()
+        }
 
-describe('autoUpdater module', function() {
-  describe('checkForUpdates', function() {
-    it('emits an error on Windows when called the feed URL is not set', function (done) {
-      if (process.platform !== 'win32') {
-        return done();
-      }
+        ipcRenderer.once('auto-updater-error', function (event, message) {
+          assert.equal(message, 'Update URL is not set')
+          done()
+        })
+        autoUpdater.setFeedURL('')
+        autoUpdater.checkForUpdates()
+      })
+    })
 
-      ipcRenderer.once('auto-updater-error', function(event, message) {
-        assert.equal(message, 'Update URL is not set');
-        done();
-      });
-      autoUpdater.setFeedURL('');
-      autoUpdater.checkForUpdates();
-    });
-  });
+    describe('setFeedURL', function () {
+      it('emits an error on Mac OS X when the application is unsigned', function (done) {
+        if (process.platform !== 'darwin') {
+          return done()
+        }
 
-  describe('setFeedURL', function() {
-    it('emits an error on Mac OS X when the application is unsigned', function (done) {
-      if (process.platform !== 'darwin') {
-        return done();
-      }
-
-      ipcRenderer.once('auto-updater-error', function(event, message) {
-        assert.equal(message, 'Could not get code signature for running application');
-        done();
-      });
-      autoUpdater.setFeedURL('');
-    });
-  });
-});
+        ipcRenderer.once('auto-updater-error', function (event, message) {
+          assert.equal(message, 'Could not get code signature for running application')
+          done()
+        })
+        autoUpdater.setFeedURL('')
+      })
+    })
+  })
+}