jest-extended
jest-extended copied to clipboard
Allow any iterable in toInclude*Members
What
Modifies the three toInclude{All,Any,Some}Members
matchers to also match on iterables.
Why
This is meant mostly for testing things that return Set
and Map
instances, but it’s generally useful for any Iterable.
Notes
I’m not sure exactly what’s wrong with the typing file, I get TS2304: Cannot find name 'Iterable'.
errors.
Housekeeping
- [x] Unit tests
- [x] Documentation is up to date
- [x] No additional lint warnings
- [x] Typescript definitions are added/updated where relevant
I’m not actually sure where to update the documentation. I updated the comments in the TypeScript definition file (to say Iterable instead of Array), but I’m not sure if there’s anything else to update.
The type definitions show errors, though, on the type of the argument (which can also be an Iterable, now), so maybe this also needs some config update to see the Iterable definition?
I’m not actually sure where to update the documentation. I updated the comments in the TypeScript definition file (to say Iterable instead of Array), but I’m not sure if there’s anything else to update.
Could you update the docs? It currently says "Array
", and maybe add an example using a Set
?