jest-extended
jest-extended copied to clipboard
fix: remove disguised type assertion
What
All the matchers that were using generic, weren't taking advantage of the full potential of typescript.
Why
The vast majority of matchers related to Array, Object and Satisfy. Doesn't take advantage of typescript's potential to be able to infer types, and because of that, the object matchers that were related to the object's key allowed passing other keys
without refactor:

with refactor:

I did this refactoring on all Object, Array and Satisfy matchers. It was just those who used generics.
Notes
Housekeeping
- [x] Unit tests
- [x] Documentation is up to date
- [x] No additional lint warnings
- [x] Typescript definitions are added/updated where relevant
I realized it's not a good idea to do this due to the .not operators.