mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
✅ Add tests to config spec
Add tests to check if the get command properly merges the stored values with the defined defaults in the schema. Two cases: - Obj has no property changes. - Obj has one or more changes to a property.
This commit is contained in:
@@ -1110,6 +1110,24 @@ describe "Config", ->
|
||||
nestedObject:
|
||||
superNestedInt: 36
|
||||
|
||||
expect(atom.config.get("foo")).toEqual {
|
||||
bar:
|
||||
anInt: 12
|
||||
anObject:
|
||||
nestedInt: 24
|
||||
nestedObject:
|
||||
superNestedInt: 36
|
||||
}
|
||||
atom.config.set("foo.bar.anObject.nestedObject.superNestedInt", 37)
|
||||
expect(atom.config.get("foo")).toEqual {
|
||||
bar:
|
||||
anInt: 12
|
||||
anObject:
|
||||
nestedInt: 24
|
||||
nestedObject:
|
||||
superNestedInt: 37
|
||||
}
|
||||
|
||||
it 'can set a non-object schema', ->
|
||||
schema =
|
||||
type: 'integer'
|
||||
|
||||
Reference in New Issue
Block a user