From: Eduardo San Martin Morote Date: Mon, 25 Apr 2022 12:39:16 +0000 (+0200) Subject: fix(testing): stub actions without app X-Git-Tag: @pinia/nuxt@0.1.9~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e4f6ca2e5ba92bc5ba835ebad4ab325a6428a5f;p=thirdparty%2Fvuejs%2Fpinia.git fix(testing): stub actions without app --- diff --git a/packages/testing/src/testing.ts b/packages/testing/src/testing.ts index 2699787e..4b3d7cc4 100644 --- a/packages/testing/src/testing.ts +++ b/packages/testing/src/testing.ts @@ -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]) })