Skip to content

Conversation

@JoseLion
Copy link
Contributor

This PR add a .toBeInstanceOf(Constructor) matcher to the the base Assertion<T> class.

@JoseLion JoseLion self-assigned this Aug 26, 2022
@JoseLion JoseLion force-pushed the feat/add-instance-of-matcher branch from e0670de to 2ac753e Compare August 26, 2022 05:09
@JoseLion JoseLion requested a review from byrpatrick August 26, 2022 14:42
import { Assertion } from "./Assertion";

export type JSObject = Record<keyof any, unknown>;
export type JSObject = Record<keyof any, any>;
Copy link
Contributor Author

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

Copy link
Member

@byrpatrick byrpatrick left a 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.

Copy link
Member

@byrpatrick byrpatrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!! 💯

@JoseLion JoseLion merged commit 48c43f0 into main Aug 26, 2022
@JoseLion JoseLion deleted the feat/add-instance-of-matcher branch August 26, 2022 23:22
@github-actions
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants