Browse Source

Add a spec for this behavior on Windows.

Charlie Hess 8 years ago
parent
commit
4fce00148d
1 changed files with 21 additions and 0 deletions
  1. 21 0
      spec/api-app-spec.js

+ 21 - 0
spec/api-app-spec.js

@@ -349,6 +349,27 @@ describe('app module', function () {
         restoreState: false
       })
     })
+
+    it('allows you to pass a custom executable and arguments', () => {
+      if (process.platform !== 'win32') return
+
+      const appFolder = path.dirname(process.execPath)
+      const updateExe = path.resolve(appFolder, '..', 'Update.exe')
+      const exeName = path.basename(process.execPath)
+
+      app.setLoginItemSettings({openAtLogin: true}, updateExe, [
+        '--processStart', `"${exeName}"`,
+        '--process-start-args', `"--hidden"`
+      ])
+
+      assert.deepEqual(app.getLoginItemSettings(), {
+        openAtLogin: true,
+        openAsHidden: false,
+        wasOpenedAtLogin: false,
+        wasOpenedAsHidden: false,
+        restoreState: false
+      })
+    })
   })
 
   describe('isAccessibilitySupportEnabled API', function () {