From: Eduardo San Martin Morote Date: Mon, 8 May 2023 15:04:34 +0000 (+0200) Subject: test: stubReset option X-Git-Tag: @pinia/nuxt@0.4.10~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=025575dd90a57915df19b317314386920b5c3aea;p=thirdparty%2Fvuejs%2Fpinia.git test: stubReset option --- diff --git a/packages/testing/src/testing.spec.ts b/packages/testing/src/testing.spec.ts index ba701974..4455dda4 100644 --- a/packages/testing/src/testing.spec.ts +++ b/packages/testing/src/testing.spec.ts @@ -161,6 +161,22 @@ describe('Testing', () => { expect(counter.n).toBe(0) }) + it('can stub $reset calls in option stores', () => { + const { counter } = factory({ stubReset: true }) + + counter.n = 5 + counter.$reset() + expect(counter.n).toBe(5) + }) + + it('can stub $reset calls in setup stores', () => { + const { counter } = factorySetupStore({ stubReset: true }) + + counter.n = 5 + counter.$reset() + expect(counter.n).toBe(5) + }) + it('executes plugins', () => { const { counter, wrapper } = factory({ plugins: [() => ({ pluginN: 0 })],