fix(types): assignability error in tests stub#124
Conversation
|
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
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: