-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins not overwritten when passed as options #828
Comments
The issue you're experiencing with Pinia store instances not being overwritten during testing with To address this, you'll need to manually configure or mock the Pinia store before running your tests to ensure that the mock store is used. This might involve mocking global imports or providing a mock store through the global properties or provides context in your test setup. Additionally, there's a similar issue discussed in the
|
The issue occurs because on
And since test-utils/src/runtime-utils/render.ts Line 136 in 08ee351
|
The issue @dosubot linked is caused by this exact same issue, the pinia store is being overwritten by the value injected in Changing the test to use either |
This comment was marked as outdated.
This comment was marked as outdated.
This is now resolved in the latest |
Environment
Darwin
v20.11.0
3.11.2
3.11.1
2.9.6
[email protected]
-
devtools
,modules
,pinia
,typescript
@nuxt/test-utils/[email protected]
,@pinia/[email protected]
-
Reproduction
https://github.com/lucasecdb/nuxt-app-pinia-repro
Install dependencies with
pnpm install
then runpnpm test
Describe the bug
If you configure a vue plugin using Nuxt plugins, like the following:
Given the following component and Pinia store:
And then try to overwrite that plugin during testing:
The instance returned by
useMyStore
will always use the Pinia store supplied byplugins/pinia
, and not from theglobal.plugins
parameter provided torenderSuspended
.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: