]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
test: fix
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 16 Jul 2021 12:55:34 +0000 (14:55 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 19 Jul 2021 09:52:25 +0000 (11:52 +0200)
__tests__/storePlugins.spec.ts

index 313571c3e2ebbdf7427ef5953105f75d92419874..de14f91f8b17881ada54e2f1fba862089b58dfcf 100644 (file)
@@ -185,13 +185,12 @@ describe('store plugins', () => {
   })
 
   it('passes the options of a setup store', (done) => {
-    function increment(n: Ref<number>) {
-      n.value++
-    }
-
     const useStore = defineSetupStore('main', () => {
       const n = ref(0)
 
+      function increment() {
+        n.value++
+      }
       const a = computed(() => 'a')
 
       return { n, increment, a }
@@ -202,9 +201,11 @@ describe('store plugins', () => {
     pinia.use((context) => {
       expect(context.options).toEqual({
         actions: {
-          increment,
+          increment: expect.any(Function),
         },
       })
+      ;(context.store as any).increment()
+      expect((context.store as any).n).toBe(1)
       done()
     })