From: Eduardo San Martin Morote Date: Fri, 16 Jul 2021 12:55:34 +0000 (+0200) Subject: test: fix X-Git-Tag: v2.0.0-rc.0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=308ed7ef2bbfe3fd76f6b5f16c4935bad63e13b5;p=thirdparty%2Fvuejs%2Fpinia.git test: fix --- 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() })