From b4c6e174d05a7899663926a5ec15d928897e6895 Mon Sep 17 00:00:00 2001 From: Donal Linehan Date: Mon, 11 Dec 2023 17:20:51 +0000 Subject: [PATCH] Don't run non launchAgent tests on mac --- tests/index.coffee | 110 +++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/tests/index.coffee b/tests/index.coffee index e9c7bcf..565b1f2 100644 --- a/tests/index.coffee +++ b/tests/index.coffee @@ -29,75 +29,77 @@ describe 'node-auto-launch', -> path: executablePath autoLaunchHelper = new AutoLaunchHelper(autoLaunch) + if not isMac + describe '.isEnabled', -> + beforeEach -> + autoLaunchHelper.ensureDisabled() - describe '.isEnabled', -> - beforeEach -> - autoLaunchHelper.ensureDisabled() - - it 'should be disabled', (done) -> - autoLaunch.isEnabled().then (enabled) -> - expect(enabled).to.equal false - done() - .catch done - return + it 'should be disabled', (done) -> + autoLaunch.isEnabled().then (enabled) -> + expect(enabled).to.equal false + done() + .catch done + return - it 'should catch errors', (done) -> - autoLaunchHelper.mockApi - isEnabled: -> - Promise.reject() + it 'should catch errors', (done) -> + autoLaunchHelper.mockApi + isEnabled: -> + Promise.reject() - autoLaunch.isEnabled().catch done - return + autoLaunch.isEnabled().catch done + return - describe '.enable', -> - beforeEach -> - autoLaunchHelper.ensureDisabled() + describe '.enable', -> + beforeEach -> + autoLaunchHelper.ensureDisabled() - it 'should enable auto launch', (done) -> - autoLaunch.enable() - .then -> autoLaunch.isEnabled() - .then (enabled) -> - expect(enabled).to.equal true - done() - .catch done - return + it 'should enable auto launch', (done) -> + autoLaunch.enable() + .then (xxx) -> + console.log 'fefew', xxx + autoLaunch.isEnabled() + .then (enabled) -> + expect(enabled).to.equal true + done() + .catch done + return - it 'should catch errors', (done) -> - autoLaunchHelper.mockApi - enable: -> Promise.reject() + it 'should catch errors', (done) -> + autoLaunchHelper.mockApi + enable: -> Promise.reject() - autoLaunch.enable().catch done - return + autoLaunch.enable().catch done + return - describe '.disable', -> - beforeEach -> - autoLaunchHelper.ensureEnabled() + describe '.disable', -> + beforeEach -> + autoLaunchHelper.ensureEnabled() - it 'should disable auto launch', (done) -> - autoLaunch.disable() - .then -> autoLaunch.isEnabled() - .then (enabled) -> - expect(enabled).to.equal false - done() - .catch done - return + it 'should disable auto launch', (done) -> + autoLaunch.disable() + .then -> autoLaunch.isEnabled() + .then (enabled) -> + expect(enabled).to.equal false + done() + .catch done + return - it 'should catch errors', (done) -> - autoLaunchHelper.mockApi - disable: -> - Promise.reject() + it 'should catch errors', (done) -> + autoLaunchHelper.mockApi + disable: -> + Promise.reject() - autoLaunch.disable().catch done - return + autoLaunch.disable().catch done + return - if isLinux - it 'should use name option', (done) -> - expect(autoLaunch.opts.appName).to.equal 'node-auto-launch test' - done() - return + if isLinux + it 'should use name option', (done) -> + expect(autoLaunch.opts.appName).to.equal 'node-auto-launch test' + done() + return # Let's test some Mac-only options