-
Notifications
You must be signed in to change notification settings - Fork 111
fix(types): assignability error in tests stub #124
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
Conversation
|
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a TypeScript type assignability error in the test suite and corrects a spelling mistake. The build process skips tests and vitest doesn't perform typechecking by default, which allowed these issues to go undetected.
- Updated the type signature of
callFunctionto correctly accept async functions returningPromise<number>instead of synchronous functions - Corrected spelling typo in test description
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
__tests__/test-util.ts |
Fixed type signature of callFunction method to accept RpcStub<(i: number) => Promise<number>> instead of RpcStub<(i: number) => number>, resolving TypeScript assignability error |
__tests__/index.test.ts |
Corrected spelling of "functinos" to "functions" in test case description |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I have read the CLA Document and I hereby sign the CLA |
commit: |
|
Thanks! FWIW, I think there are also a couple places in the test where TypeScript complains about infinite recursion, which seems like a deeper problem with the way the types work right now that needs to be addressed.
|
I happened to notice there's a few errors in
index.test.ts. Seems like that's because the build skips the tests (naturally) and vitest doesn't do typechecking.here's the error: