alias in test files while using workspace not working
Environment
os: Ubuntu 22.04 node: 21.0.0 nuxt: 3.9.3 @nuxt/test-utils: 2.4.3 vitest: 1.0.4 pnpm: 8.3.1
Reproduction
https://github.com/ThiloHettmer/test-utils-alias-issue/tree/main
Describe the bug
Hi all,
we use a monorepo with multiple layers and apps. The aliases are declared in root via an alias.ts file. They work in our application but not in test files. I've tried alot of things to resolve these aliases but could not get it to work. Note: we want to start the vitest from the root folder and got a vitest.workspace.ts file.
Perhaps I'm just missing something.
Thanks, and gd
Additional context
No response
Logs
No response
Hello,
You can resolve it by using extends property instead of plain string.
export default defineWorkspace([
{
extends: './path/to/app/vitest.config.js'
}
])
but unfortunately, a new error occurs: ref is not defined (If you are using vue ref for example). This is related to nuxt auto-imports feature. I don't know how to solve it at the moment.