alias in test files while using workspace not working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 437
- Forks
- 120
- Avg merge
- 22h 52m
- Merged PRs (30d)
- 23
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction and inspect the root alias.ts and vitest.workspace.ts files, then run the workspace tests from the repository root using the reported Nuxt and Vitest setup. Done means aliases declared at the root resolve in test files as they already do in the application.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, nuxtjs, typescript
- Domain
- testing, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100