Skip to content

Commit

Permalink
fix: @pinia/nuxt breaks createTestingPinia
Browse files Browse the repository at this point in the history
fix #2555
  • Loading branch information
OnlyWick committed Feb 13, 2024
1 parent e132a11 commit b46ee8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/testing/src/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
StateTree,
_DeepPartial,
PiniaPluginContext,
getActivePinia,
} from 'pinia'

export interface TestingOptions {
Expand Down Expand Up @@ -106,7 +107,7 @@ export function createTestingPinia({
fakeApp = false,
createSpy: _createSpy,
}: TestingOptions = {}): TestingPinia {
const pinia = createPinia()
const pinia = getActivePinia() ?? createPinia()

// allow adding initial state
pinia._p.push(({ store }) => {
Expand Down

0 comments on commit b46ee8a

Please sign in to comment.