   config.set "editor.autoIndent", false
   config.set "core.disabledPackages", ["package-that-throws-an-exception"]
   config.save.reset()
+  atom.config = config
+  window.config = config
 
   # make editor display updates synchronous
   spyOn(Editor.prototype, 'requestDisplayUpdate').andCallFake -> @updateDisplay()


beforeEach ->
  $.fx.off = true
  window.project = new Project(specProjectPath)

  window.resetTimeouts()
  atom.packages.packageStates = {}
  spyOn(atom, 'saveWindowState')
  syntax.clearGrammarOverrides()
  syntax.clearProperties()

  # used to reset keymap after each spec
  bindingSetsToRestore = _.clone(keymap.bindingSets)
  bindingSetsByFirstKeystrokeToRestore = _.clone(keymap.bindingSetsByFirstKeystroke)

  # reset config before each spec; don't load or save from/to `config.json`
  window.config = new Config()
  window.config.packageDirPaths.unshift(fixturePackagesPath)
  spyOn(config, 'load')
  spyOn(config, 'save')
  config.set "editor.fontFamily", "Courier"

atom.themes.requireStylesheet '../static/jasmine'

fixturePackagesPath = path.resolve(__dirname, './fixtures/packages')
atom.keymap.loadBundledKeymaps()
[bindingSetsToRestore, bindingSetsByFirstKeystrokeToRestore] = []

$(window).on 'core:close', -> window.close()
