-
Notifications
You must be signed in to change notification settings - Fork 472
Projects must list all files or use an 'include' pattern.ts(6307) #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What's the path of your test file? |
test file is in |
haoqunjiang
added a commit
to haoqunjiang/create-vue
that referenced
this issue
Feb 15, 2022
Fixes vuejs#55 Fixes the case that a `.spec.ts` file inside `__test__/` imports a module outside of `__test__/` (a cross-(typescript-)project reference). Note that TypeScript looks for `include` patterns in `references` top-down, so `tsconfig.app.json` must come before `tsconfig.vitest.json` so that the `src/**` modules can get the most-accurate type hints. The previous tsconfig only works for `.vue` imports in `.spec.ts`, which seems to be a Volar bug. We shouldn't rely on that. This fix is a more accurate configuration.
Opened a PR for this: #56 Thank you so much for the report! It's a huge oversight on my part. |
@sodatea no worries! I'm starting a brand new project. So I either open issues here and there or PRs when I know how to fix them! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
I'm trying to get unit tests to work properly and don't know how to deal with the following situation:
I started a new project with
npm init vue@3
like so:✔ Add TypeScript? … No / Yes
✔ Add JSX Support? … No / Yes
✔ Add Vue Router for Single Page Application development? … No / Yes
✔ Add Pinia for state management? … No / Yes
✔ Add Vitest for Unit Testing? … No / Yes
✔ Add Cypress for End-to-End testing? … No / Yes
✔ Add ESLint for code quality? … No / Yes
✔ Add Prettier for code formatting? … No / Yes
At root of the
src
folder I add a simple TS file:And in my test, when I import it:
I get the following error message:
I left the tsconfigs file untouched, but here there are:
The text was updated successfully, but these errors were encountered: