From 1c6a07c68d8f4d6cd2ade518b0152d0231415705 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 2 Feb 2017 08:01:47 -0800 Subject: [PATCH] Clear Update.exe login item settings in afterEach --- spec/api-app-spec.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/spec/api-app-spec.js b/spec/api-app-spec.js index 53d8235f7b44..085522a0cc9c 100644 --- a/spec/api-app-spec.js +++ b/spec/api-app-spec.js @@ -313,12 +313,20 @@ describe('app module', function () { describe('app.get/setLoginItemSettings API', function () { if (process.platform === 'linux') return + const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe') + const processStartArgs = [ + '--processStart', `"${path.basename(process.execPath)}"`, + '--process-start-args', `"--hidden"` + ] + beforeEach(function () { app.setLoginItemSettings({openAtLogin: false}) + app.setLoginItemSettings({openAtLogin: false, path: updateExe, args: processStartArgs}) }) afterEach(function () { app.setLoginItemSettings({openAtLogin: false}) + app.setLoginItemSettings({openAtLogin: false, path: updateExe, args: processStartArgs}) }) it('returns the login item status of the app', function () { @@ -353,15 +361,6 @@ describe('app module', function () { 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) - - const processStartArgs = [ - '--processStart', `"${exeName}"`, - '--process-start-args', `"--hidden"` - ] - app.setLoginItemSettings({openAtLogin: true, path: updateExe, args: processStartArgs}) assert.equal(app.getLoginItemSettings().openAtLogin, false)