From 235483b745e0844c4f63f9e1e23a50f1ce33565d Mon Sep 17 00:00:00 2001 From: OnlyWick Date: Wed, 14 Feb 2024 02:20:30 +0800 Subject: [PATCH] fix: @pinia/nuxt breaks createTestingPinia close #2555. --- packages/nuxt/src/runtime/plugin.vue3.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/runtime/plugin.vue3.ts b/packages/nuxt/src/runtime/plugin.vue3.ts index 5290c06dc8..6e4d5367ad 100644 --- a/packages/nuxt/src/runtime/plugin.vue3.ts +++ b/packages/nuxt/src/runtime/plugin.vue3.ts @@ -4,7 +4,11 @@ import { defineNuxtPlugin, Plugin } from '#app' const plugin: Plugin<{ pinia: Pinia }> = defineNuxtPlugin((nuxtApp) => { const pinia = createPinia() - nuxtApp.vueApp.use(pinia) + + if (process.env.NODE_ENV !== 'test') { + nuxtApp.vueApp.use(pinia) + } + setActivePinia(pinia) if (process.server) {