 
 beforeEach ->
   $.fx.off = true
-  window.project = new Project(specProjectPath)
+  atom.project = new Project(specProjectPath)
+  window.project = atom.project
 
   window.resetTimeouts()
   atom.packages.packageStates = {}
   spyOn(atom, 'saveWindowState')
-  syntax.clearGrammarOverrides()
-  syntax.clearProperties()
+  atom.syntax.clearGrammarOverrides()
+  atom.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)
+  config = new Config()
+  config.packageDirPaths.unshift(fixturePackagesPath)
   spyOn(config, 'load')
   spyOn(config, 'save')
   config.set "editor.fontFamily", "Courier"

  config.set "editor.autoIndent", false
  config.set "core.disabledPackages", ["package-that-throws-an-exception"]
  config.save.reset()

  # make editor display updates synchronous
  spyOn(Editor.prototype, 'requestDisplayUpdate').andCallFake -> @updateDisplay()

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

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

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