Add in matchers that will allow for easier stubbing
Why will this be beneficial?
It will facilitate better matching for whens, which in turn will make stubbing better.
Misc. info
Matchers will have to have some defining way to tell they are matchers. Maybe an isMatcher function, or have all matchers extend a common matcher class. We have to be able to tell which args are legitimate values and which ones are matchers.
What kind of issue is this? (bug, feature, etc)
Feature
What is the proposed change?
Add in matchers that will allow for easier stubbing
Why will this be beneficial?
It will facilitate better matching for whens, which in turn will make stubbing better.
Misc. info
Matchers will have to have some defining way to tell they are matchers. Maybe an
isMatcher
function, or have all matchers extend a commonmatcher
class. We have to be able to tell which args are legitimate values and which ones are matchers.Some thoughts for starting matchers:
matchers.regex(/do I look pretty/)
when(matchers.anyString())
when(matchers.anyNumber())
when(isA(Error))