Open agmcleod opened 3 months ago
@agmcleod This is kinda expected behaviour, since Start will fill in the ~
alias automatically through Vinxi, whereas Vitest isn't aware of Start's configurations. Perhaps there should be @solidjs/start/vitest
that fills in stuff like this, but any custom aliases would need to be duplicated in app.config.ts
or vitest.config.ts
unless you use a custom Vite plugin.
@Brendonovich Yeah that's what im suggesting, where the start template of vitest doesn't seem to support the aliases that start itself provides. Was able to find out the change needed to make it work, but im wondering if that can be provided by the vitest template instead?
Duplicates
Latest version
Current behavior šÆ
When I test a component that imports another component or file via the ~ alias, the import fails to resolve:
Expected behavior š¤
Ideally these imports should resolve since the dev server supports these paths.
This seems to be fixable by updating the vitest.config.ts file
Steps to reproduce š¹
Steps:
yarn create solid
. Be sure to select the vitest templatesrc/routes/index.test.tsx
and put in the following contents:Then try to run the tests
Context š¦
No response
Your environment š