Disable 'package-that-throws-an-exception' except in spec that uses it

Loading this package logs a warning, so to minimize noise in the spec
console, it should only be loaded when `console.warn` is mocked.
This commit is contained in:
Nathan Sobo
2013-01-27 12:12:39 -07:00
parent a83b8583f0
commit 0be4ad547a
2 changed files with 2 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ describe "the `atom` global", ->
expect(rootView.activatePackage).toHaveBeenCalled()
it "logs warning instead of throwing an exception if a package fails to load", ->
config.set("core.disabledPackages", [])
spyOn(console, "warn")
expect(-> atom.loadPackage("package-that-throws-an-exception")).not.toThrow()
expect(console.warn).toHaveBeenCalled()

View File

@@ -35,6 +35,7 @@ beforeEach ->
spyOn(config, 'save')
config.set "editor.fontSize", 16
config.set "editor.autoIndent", false
config.set "core.disabledPackages", ["package-that-throws-an-exception"]
# make editor display updates synchronous
spyOn(Editor.prototype, 'requestDisplayUpdate').andCallFake -> @updateDisplay()