-
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
feat(assertion): Add .toBeInstanceOf(Constructor)
matcher
#57
Conversation
e0670de
to
2ac753e
Compare
@@ -3,7 +3,7 @@ import { isDeepStrictEqual } from "util"; | |||
|
|||
import { Assertion } from "./Assertion"; | |||
|
|||
export type JSObject = Record<keyof any, unknown>; | |||
export type JSObject = Record<keyof any, any>; |
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.
This change fixes issues with type inference in generic constraints. The type unknown
is too specific to be part of a constraint
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.
@JoseLion is looking good!
I left some comments and suggestions!
In general, I think it's more natural to relate an instance with a class and not with its constructor.
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.
LGTM!! 💯
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR add a
.toBeInstanceOf(Constructor)
matcher to the the baseAssertion<T>
class.