Closed MarkTallentire closed 2 years ago
AFAIK every Cypress command is actually async, and mount
is probably async too
If you call store = useStore()
after the mount, you're executing it before the mount actually took place IIRC, and that may be the problem
Thanks for this, we eventually solved it by using the injected store in our other boot file.
Previously we were just using store = useStore()
instead of injecting via the boot method i.e
boot(({store}) => {
const userStore = useStore(store)
})
Hi,
We previously added Pinia to our project using a boot file that contained App.Use(Pinia) and our tests ran fine. We came up against a use case today that meant we wanted to use Pinia inside another bootfile so we refactored to using Pinia as the docs suggest with a index.ts inside our stores folder containing
export default store(() => { const pinia = createPinia(); return pinia; });
However now our tests that rely on the store all fail with the error. We're exclusively using Cypress Component Testing.
I've had a dig around and can't find any open issues on this repo, Pinias repo or the main Quasar repo, any solutions?
Example Test: