]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix(testing): stub actions without app
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 25 Apr 2022 12:39:16 +0000 (14:39 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 25 Apr 2022 12:39:16 +0000 (14:39 +0200)
packages/testing/src/testing.ts

index 2699787ea4bdfd5634fea40ebafd51483c822992..4b3d7cc4c363d53c0b1aaf1926d11487cdd46104 100644 (file)
@@ -120,7 +120,8 @@ export function createTestingPinia({
     throw new Error('You must configure the `createSpy` option.')
   }
 
-  pinia.use(({ store, options }) => {
+  // stub actions
+  pinia._p.push(({ store, options }) => {
     Object.keys(options.actions).forEach((action) => {
       store[action] = stubActions ? createSpy() : createSpy(store[action])
     })