-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Typescript compiler flags error in generated forgotPassword.test.ts file #188
Comments
I'll have to note that I'm running tsc manually because I broke husky somehow, so if this was something fixed via code in a hook via Husky, please feel free to close! |
Update 2: Doing |
Thanks! I think I vote for |
Ah, I was going to help do this change, but tsc complains that a comma was expected if I remove the spread operator :((
I tried a few permutations with the |
@roesh did |
@flybayer that did work, and I have it set to that in my personal project, but I assumed we wanted to not have the generic and use I might have misunderstood that comment then. Shall I modify |
@roesh I'm still a bit fuzzy. I think this is what you are saying:
Since both work, then let's go the more minimal approach and use |
@flybayer Ah, I didn't mean that, rather
However, Does tsc not throw the same error for you at |
@roesh ah got it! Ok then yes, make a PR with |
What is the problem?
In line 12 of \app\auth\mutations\forgotPassword.test.ts,
...jest.requireActual("blitz")!,
causes tsc to throw this error:Spread types may only be created from object types.ts(2698)
Seems like the issue is that spread types are not supported on generics (and I'm assuming that the jest.requireActual("blitz") call is returning an object, but the signature denotes that it's "unkown", which is what is causing the issue?
function jest.requireActual<unknown>(moduleName: string): unknown
There's an open issue at microsoft/TypeScript#10727, so this might not be a blitz related issue, but it may make sense to implement a workaround in the meanwhile
Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
Run
blitz -v
and paste the output here:The text was updated successfully, but these errors were encountered: