You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
In an Angular project created by CLI, there are three tsconfig files: the base one, the app one and the tests (spec) one. Since Angular has been moving towards esbuild and Vite to build its apps, I'm trying Vitest to run its unit tests. For this, I'm using the integration made by Analog.js (https://analogjs.org/docs/features/testing/vitest).
Everything works fine testing-wise, but in VSCode, and after I removed every package related to any other test runner (karma and jasmine in this case), when I open any ´src/**/*.spec.ts´ file, there are error concerning typing not being resolved for every global testing function, like ´describe´, ´it´ or ´expect´, even though, and as per instructed, ´vitest/globals´ are being correctly referenced in the ´tsconfig.spec.json´.
When I open any testing file, aside of the errors, VSCode tells me the config file it's using to resolve this file is the base one (tsconfig.json). And, if I add ´vitest/globals´ to the base config, errors disappear.
Please provide a link to a minimal reproduction of the bug
Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ts(2582)
Cannot find name 'beforeEach'.ts(2304)
Please provide the environment you discovered this bug in (run ng version)
I have doubts about this issue being Angular related. Maybe this is a TypeScript and/or VSCode error. Even so, this issue might be of the interest of the Angular team concerning the way ´tsconfig.json´ files are being used by VSCode to resolve its ts files.
The text was updated successfully, but these errors were encountered:
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
In an Angular project created by CLI, there are three tsconfig files: the base one, the app one and the tests (spec) one. Since Angular has been moving towards esbuild and Vite to build its apps, I'm trying Vitest to run its unit tests. For this, I'm using the integration made by Analog.js (https://analogjs.org/docs/features/testing/vitest).
Everything works fine testing-wise, but in VSCode, and after I removed every package related to any other test runner (karma and jasmine in this case), when I open any ´src/**/*.spec.ts´ file, there are error concerning typing not being resolved for every global testing function, like ´describe´, ´it´ or ´expect´, even though, and as per instructed, ´vitest/globals´ are being correctly referenced in the ´tsconfig.spec.json´.
When I open any testing file, aside of the errors, VSCode tells me the config file it's using to resolve this file is the base one (tsconfig.json). And, if I add ´vitest/globals´ to the base config, errors disappear.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-kgrhhncg
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
Note
I have doubts about this issue being Angular related. Maybe this is a TypeScript and/or VSCode error. Even so, this issue might be of the interest of the Angular team concerning the way ´tsconfig.json´ files are being used by VSCode to resolve its ts files.
The text was updated successfully, but these errors were encountered: