mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Reset the loadedPackages before each test.
Also stop including fixturePackagesPath in configs.packageDirPaths. Instead load fixture packages as needed
This commit is contained in:
committed by
Corey Johnson & Kevin Sawicki
parent
3078d74e5d
commit
a89fdd7714
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user