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
I fully support this. The current implementation of typing fn to Function requires constant casting and also goes against official TS recommendation to avoid using Function as a type in any interfaces.
Is your feature request related to a problem? Please describe.
The current
fn
signature in the Deno std library is:This lacks type safety and flexibility compared to Jest's
fn
:See https://github.com/jestjs/jest/blob/main/packages/jest-mock/src/index.ts#L1082
It makes mocking less intuitive and harder to work with in a type-safe way.
Describe the solution you'd like
Update the
fn
function signature to match Jest's API for better type inference and usability:Describe alternatives you've considered
I would be happy to contribute this change myself and submit a pull request to update the implementation and associated documentation.
The text was updated successfully, but these errors were encountered: