Vitest auto-import functions
Is there a way to correctly auto-import functions from Vitest, like
it
and expect
while preserving their function types and not have them show as any
?
I got this far using the config, which generates the imports in the imports.d.ts
file, but they still show up as any
in the test files.
3 Replies
Name only allows a single name as string
presets: [
{
from: 'vue',
imports: [
'ref',
'reactive',
// ...
]
}
]
That works better
GitHub
GitHub - unjs/unimport: Unified utils for auto importing APIs in mo...
Unified utils for auto importing APIs in modules. Contribute to unjs/unimport development by creating an account on GitHub.
This works perfectly, thanks! Is this still fine to do if I'm using it inside a layer, and then the app that extends from the layer also has these auto-imported as part of its test setup, duplicating the types?