jest-extended
                                
                                 jest-extended copied to clipboard
                                
                                    jest-extended copied to clipboard
                            
                            
                            
                        Suggestion: add a new matcher - toHaveAllMembersOfType(...)
Feature Request
Description:
I often find it useful (considering the nature of the project I'm working on) to test that all array-members are of the same type, which can currently be done by using the toSatisfyAll matcher:
expect(arr).toSatisfyAll(s => typeof s === 'string')
However, this could be done by a dedicated matcher and have a shorter syntax.
Possible solution:
Introduce a new matcher, say toHaveAllMembersOfType(), that will be used like:
expect(arr).toHaveAllMembersOfType(Number)
If that makes sense, I don't mind submitting a PR for that.
Hey @harelmoshe I like this!
I would suggest changing the name to .toIncludeAllMembersOfType(Type)  to be consistent with current array matchers.
Do you want to send a PR for this?
@mattphillips sounds great :) I would love to send a PR, will do in the next couple of days.
@mattphillips Which option would you think of as more intuitive to represent the type:
expect([1, 2, 3]).toIncludeAllMembersOfType(Number)
or
expect([1, 2, 3]).toIncludeAllMembersOfType(expect.any(Number))
?
The first one is more concise but can be misleading (since Number is not the typeof 1, e.g.), while
the second one is more jest-ish but kind of verbose. Any thoughts here?