Skip to content
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

Document using Pinia in testing #591

Open
obulat opened this issue Mar 22, 2022 · 0 comments
Open

Document using Pinia in testing #591

obulat opened this issue Mar 22, 2022 · 0 comments
Assignees
Labels
📄 aspect: text Concerns the textual material in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend

Comments

@obulat
Copy link
Contributor

obulat commented Mar 22, 2022

When using Pinia outside of the components, as in the store tests, we need to use setActivePinia(createPinia()) to prevent the following error:

Error: [🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
	const pinia = createPinia()
	app.use(pinia)
This will fail in production.

I'm unclear of when it's necessary to use setActivePinia. Could you add a blurb in the TESTING_GUIDELINES explaining that (or else open an issue to do it in a separate PR)?

Originally posted by @sarayourfriend in WordPress/openverse-frontend#1040 (comment)

@obulat obulat self-assigned this Mar 22, 2022
@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon 📄 aspect: text Concerns the textual material in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users labels Mar 22, 2022
@obulat obulat transferred this issue from WordPress/openverse-frontend Feb 22, 2023
@obulat obulat added the 🧱 stack: frontend Related to the Nuxt frontend label Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 aspect: text Concerns the textual material in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant