Reset the loadedPackages before each test.

Also stop including fixturePackagesPath in configs.packageDirPaths. Instead load fixture packages as needed
This commit is contained in:
Corey Johnson
2013-02-06 15:52:16 -08:00
committed by Corey Johnson & Kevin Sawicki
parent 3078d74e5d
commit a89fdd7714

View File

@@ -18,19 +18,20 @@ require.paths.unshift(fixturePackagesPath)
[bindingSetsToRestore, bindingSetsByFirstKeystrokeToRestore] = []
# Specs rely on TextMate bundles (but not atom packages)
pack.load() for pack in atom.getTextMatePackages()
textMatePackages = atom.loadTextMatePackages()
beforeEach ->
window.fixturesProject = new Project(require.resolve('fixtures'))
window.resetTimeouts()
atom.loadedPackages = _.clone(textMatePackages)
# 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()
config.packageDirPaths.unshift(fixturePackagesPath)
spyOn(config, 'load')
spyOn(config, 'save')
config.set "editor.fontSize", 16