Docs: Vitest setup: Documentation for how to add vite-tsconfig-paths to support absolute paths in tests #72424
Closed
SanjoSolutions
started this conversation in
Ideas
Replies: 1 comment
-
I have created a PR for this: #72430 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
Some projects might have set-up a import alias like
"@/*": ["./src/*"]
. This is an option that is available when one creates a Next.js app with "create-next-app". To support imports with such import alias in test files it seems to be required to set up a solution like vite-tsconfig-paths. By providing documentation for how to configure this, it can potentially be made more straight forward to users to make this work (saving Googling and picking a solution).Proposal
I suggest to add documentation for configuring vite-tsconfig-paths in the section https://nextjs.org/docs/app/building-your-application/testing/vitest#manual-setup.
Beta Was this translation helpful? Give feedback.
All reactions