       latestVersion: '99.0.0'
       version: '1.0.0'
 
-    [resolveOutdated, rejectOutdated] = []
-
     beforeEach ->
       # skip packman stubbing - without this, getOutdated() is called another time
       # this is not an issue in actual usage as getOutdated() isn't blocked on a spy
       panel.beforeShow(updates: [pack])
-      spyOn(packageManager, 'getOutdated').andReturn(new Promise((resolve, reject) -> [resolveOutdated, rejectOutdated] = [resolve, reject]))
 
     it 'disables itself when clicked until the list of outdated packages is returned', ->
       # Updates panel checks for updates on initialization so resolve the promise

        notifications[0].options.buttons[0].onDidClick()
        expect(atom.restartApplication).toHaveBeenCalled()

    it 'disables the Update All button if all updates succeed', ->
      expect(panel.updateAllButton.prop('disabled')).toBe false
      panel.updateAll()


describe 'UpdatesPanel', ->
  panel = null
  packageManager = new PackageManager
  [resolveOutdated, rejectOutdated] = []

  beforeEach ->
    # This spy is only needed for the Check for Updates specs,
    # but we have to instantiate it here because we need to pass the spy to the UpdatesPanel
    spyOn(packageManager, 'getOutdated').andReturn(new Promise((resolve, reject) -> [resolveOutdated, rejectOutdated] = [resolve, reject]))
    panel = new UpdatesPanel(packageManager)
    jasmine.attachToDOM(panel[0])

  it "shows updates when updates are available", ->
    pack =
