Add spec for re-registering schema after unloading package

This commit is contained in:
Max Brunsfeld
2015-12-08 11:27:20 -08:00
parent 314a1234f4
commit d835ac0ac8

View File

@@ -154,7 +154,6 @@ describe "PackageManager", ->
it "registers the config schema in the package's metadata, if present", ->
pack = atom.packages.loadPackage("package-with-json-config-schema")
expect(atom.config.getSchema('package-with-json-config-schema')).toEqual {
type: 'object'
properties: {
@@ -165,6 +164,18 @@ describe "PackageManager", ->
expect(pack.mainModule).toBeNull()
atom.packages.unloadPackage('package-with-json-config-schema')
atom.config.clear()
pack = atom.packages.loadPackage("package-with-json-config-schema")
expect(atom.config.getSchema('package-with-json-config-schema')).toEqual {
type: 'object'
properties: {
a: {type: 'number', default: 5}
b: {type: 'string', default: 'five'}
}
}
describe "when a package does not have deserializers, view providers or a config schema in its package.json", ->
beforeEach ->
mockLocalStorage()