Skip to content
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

[expect-type] Clarification on toEqualType versus toMatchType #30

Closed
papb opened this issue May 7, 2020 · 1 comment
Closed

[expect-type] Clarification on toEqualType versus toMatchType #30

papb opened this issue May 7, 2020 · 1 comment

Comments

@papb
Copy link
Contributor

papb commented May 7, 2020

Hello!

Thanks for the explanation in this comment. However, it is still not fully clear to me (probably because I'm not familiar with Jest's toMatchObject either).

Please confirm if my understanding is correct:

let a: A;
let b: B;

// Passes if and only if `A` is identical to `B`
expectTypeOf(a).toEqualTypeOf(b)

// Passes if and only if `A extends B`
// In other words, passes if and only if the assignment `b = a` is valid
expectTypeOf(a).toMatchTypeOf(b)

Is this correct?

Thanks!!

@papb papb changed the title Clarification on toEqualType versus toMatchType [expect-type] Clarification on toEqualType versus toMatchType May 7, 2020
@papb
Copy link
Contributor Author

papb commented May 12, 2020

Solved by #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant