Browse Source

tests: store state generated from closure

Ryan Chandler 4 years ago
parent
commit
dfb97da423
7 changed files with 22 additions and 0 deletions
  1. 0 0
      dist/spruce.js
  2. 0 0
      dist/spruce.js.map
  3. 0 0
      dist/spruce.module.js
  4. 0 0
      dist/spruce.module.js.map
  5. 0 0
      dist/spruce.umd.js
  6. 0 0
      dist/spruce.umd.js.map
  7. 22 0
      tests/store.spec.js

File diff suppressed because it is too large
+ 0 - 0
dist/spruce.js


File diff suppressed because it is too large
+ 0 - 0
dist/spruce.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/spruce.module.js


File diff suppressed because it is too large
+ 0 - 0
dist/spruce.module.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/spruce.umd.js


File diff suppressed because it is too large
+ 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'
     })

Some files were not shown because too many files changed in this diff