-
Notifications
You must be signed in to change notification settings - Fork 994
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
Setting "typeRoots" in tsconfig.json for jest #1820
Comments
If they don't see any problems with this it should definitely be added to https://redwoodjs.com/docs/typescript#web |
👍 This is the way. |
@jangxyz Would you be keen to open a PR for this? |
Ran into this as well and just wanted to make sure API's |
I am trying to make vscode understand
describe
,it
and etc for test files, but following the document on typescript did not help.Googling around for couple of hours, I found out that setting
compilerOptions.typeRoots
option to something else prevents from finding jest types.From the tsconfig docs:
typeRoots
is currently set to "../.redwood
", which I guess is mainly for types built by redwood like routes, but this is blocking the default behavior.I have actually succeeded on removing errors by commenting out the
typeRoots
option.(Which I guess means that I can't use named routes)
I don't know if I can set the default behavior of recursively searching for
node_modules/@types
, but I'm assuming setting only for the root directory will be fine for redwood?This is the same issue with #1400 (comment) . I don't know if others are having same issues -- vscode errors seem to pop all over the place. If it is a common issue, I wonder if this can be included in the docs.
The text was updated successfully, but these errors were encountered: