You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Heyo! I'm trying to introduce some basic tests on composable that use some setup hooks like useContext() but I'm getting the following error
Error: This must be called within a setup function.
5| const show = ref(false);
6|
7| const { $globals } = useContext();
| ^
8|
9| const passwordIcon = computed(() => {
Obviously, I'm not in a setup context and don't have access to the Nuxt instance. But.... I can't seem to find anything on how to setup testing with the composition API and Nuxt 2.
Anyone have a working example using the Nuxt Composition API and testing composable?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Heyo! I'm trying to introduce some basic tests on composable that use some
setup
hooks likeuseContext()
but I'm getting the following errorObviously, I'm not in a setup context and don't have access to the Nuxt instance. But.... I can't seem to find anything on how to setup testing with the composition API and Nuxt 2.
Anyone have a working example using the Nuxt Composition API and testing composable?
Here's the basic test if it helps
Beta Was this translation helpful? Give feedback.
All reactions