Closed adamdehaven closed 3 months ago
I can get around the error by adding ogImage: { enabled: false }
to my vitest overrides; however, I'm curious if this is the best solution
This would be an upstream issue in https://github.com/nuxt/test-utils, not sure there's anything I can do within the module to help.
The workaround your using looks good.
I'm wondering if there's an underlying issue in the test-utils repo whereby the equivalent of the prepare
script is either different, or doesn't accurately generate all necessary types for installed modules 🤔
Unsure of where to look over there
I'll need to close this for now because there aren't any more next steps I can take.
The workaround is good because nuxt-og-image will automatically mock composable functions when the module is disabled so it's actually working perfectly.
Ideally @nuxt/test-utils
has a solution for this in the future though.
Yep the composables are mocked so no errors. Only suggestion would be a note in the docs somewhere
Any idea what to do if im getting this but not using vitest or @nuxt/test-utils?
Describe the bug
When mounting a component with
mountSuspended
orrenderSuspended
via@nuxt/test-utils
, when the exports are compiled for the tests,defineOgImageComponent
(anddefineOgImage
, etc.) composable is not available for import and throws an error:When running
nuxt prepare
manually, the exports exist; however, when testing with@nuxt/test-utils
the composables do not seem to be available/resolve correctly.Reproduction
No response
System / Nuxt Info