timkindberg / jest-when

Jest support for mock argument-matched return values.
MIT License
738 stars 39 forks source link

Why not add methods in WhenMock's prototype? #28

Closed chinesedfan closed 5 years ago

chinesedfan commented 5 years ago

Just curious.

timkindberg commented 5 years ago

Probably just ignorance. I did start by adding calledWith as a class method, but it was not giving me auto complete in Intellij, until I added it via this in the constructor. And I sort of just stuck with it and then we copy/pasted the pattern. If you want to muck with a refactor I'm fine with it.