Przeglądaj źródła

tests: store state generated from closure

Ryan Chandler 4 lat temu
rodzic
commit
dfb97da423

Plik diff jest za duży
+ 0 - 0
dist/spruce.js


Plik diff jest za duży
+ 0 - 0
dist/spruce.js.map


Plik diff jest za duży
+ 0 - 0
dist/spruce.module.js


Plik diff jest za duży
+ 0 - 0
dist/spruce.module.js.map


Plik diff jest za duży
+ 0 - 0
dist/spruce.umd.js


Plik diff jest za duży
+ 0 - 0
dist/spruce.umd.js.map


+ 22 - 0
tests/store.spec.js

@@ -29,6 +29,28 @@ test('Spruce.store() > existing namespace will not be overwritten', () => {
         bob: 'car'
     })
 
+    expect(Spruce.store('testing')).toEqual({
+        foo: 'bar'
+    })
+})
+
+test('Spruce.store() > can be used with functions that generate stores', () => {
+    Spruce.store('testing', function () {
+        return {
+            foo: 'bar'
+        }
+    })
+
+    expect(Spruce.store('testing')).toEqual({
+        foo: 'bar'
+    })
+
+    Spruce.store('testing', function () {
+        return {
+            bar: 'car'
+        }
+    })
+
     expect(Spruce.store('testing')).toEqual({
         foo: 'bar'
     })

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików