]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
test: stubReset option
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 8 May 2023 15:04:34 +0000 (17:04 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 8 May 2023 15:05:10 +0000 (17:05 +0200)
packages/testing/src/testing.spec.ts

index ba70197460ed7a83c2821ea87b8f592d67a812d1..4455dda431d7cee76578a3dd4538c73170a5277a 100644 (file)
@@ -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 })],