From 308ed7ef2bbfe3fd76f6b5f16c4935bad63e13b5 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 16 Jul 2021 14:55:34 +0200 Subject: [PATCH] test: fix --- __tests__/storePlugins.spec.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/__tests__/storePlugins.spec.ts b/__tests__/storePlugins.spec.ts index 313571c3..de14f91f 100644 --- a/__tests__/storePlugins.spec.ts +++ b/__tests__/storePlugins.spec.ts @@ -185,13 +185,12 @@ describe('store plugins', () => { }) it('passes the options of a setup store', (done) => { - function increment(n: Ref) { - 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() }) -- 2.47.2