 fixturePackagesPath = path.resolve(__dirname, './fixtures/packages')
 atom.packages.packageDirPaths.unshift(fixturePackagesPath)
 atom.keymap.loadBundledKeymaps()
-keyBindingsToRestore = null
+keyBindingsToRestore = _.clone(atom.keymap.allBindings())
 
 $(window).on 'core:close', -> window.close()
 $(window).on 'unload', ->

  else
    atom.project = new Project(path.join(@specDirectory, 'fixtures'))
  window.project = atom.project

  window.resetTimeouts()
  atom.packages.packageStates = {}

  addCustomMatchers(this)

afterEach ->
  atom.deactivatePackages()
  atom.menu.template = []

