sinon
sinon copied to clipboard
Name differences
It might be logical reasons that I don't know about, but I wonder about some of the name differences between sinon-methods:
spy.notCalledWith assert.neverCalledWith
Should they have the same name?
stub.callsFake stub.callsArg stub.callsArgWith stub.callThrough stub.callArg stub.callArgWith
I often end up checking the docs where there is 'calls*' and where there is 'call*'.
Thank you for pointing it out!
I agree, there should be more consistency in naming.
I think an approach like this could work:
- create a
README
or wiki page, describing the naming conventions - rename all methods that do not follow the naming conventions
- add deprecation warnings to all deprecated method names
- publish new version
- in a later
MAJOR
version, remove the deprecated methods
Do you want to take a stab at it?
That sounds like a good approach.
I think Sinon is a very good library, and would very much like to contribute to it if possible. Unfortunately, there is no room for this at the moment, hopefully it will change soon.
Related discussion in #1000.