Disabling/Removing Symbol(pinia)
warnings in test console?
#2635
-
I've got pinia setup with Vitest, and it all works fine but I do have 1 annoyance, and it's that my test logs are filled with this message:
I suspect this is because I have My setup file has this: config.global.plugins = [
createTestingPinia({ createSpy: vi.fn }),
]; And then, in component tests where a specific store is involved, or if I need to change Pinia's global settings (like disabling mount(MyComponent, {
global: {
plugins: [ createTestingPinia({ initialState: {} }) ]
}
}) It works fine, but for every single test where I do this I get that above message. Is there any way of disabling that, because it doesn't seem like it's relevant for me? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The warning comes from Vue, not pinia. You should override the global objects (if that's the way you are doing it) when passing options to However, I recommend you to remove the |
Beta Was this translation helpful? Give feedback.
The warning comes from Vue, not pinia. You should override the global objects (if that's the way you are doing it) when passing options to
mount()
. You can clear the plugins arrayconfig.global.plugins = []
.However, I recommend you to remove the
createTestingPinia()
from the global plugin settings. Only add it in tests where it's needed.