I'm not sure how optional dependencies package.json work, but I thought it might be useful to have the noops be sinon.spy/sinon.stub instances if sinon is available as an optional peer dependency, as that makes them real easy to bust up in tests. But there's also nothing preventing anyone from just overridding the noops with custom stubs of their own choosing, so I guess it's NBD really...
Well, I guess one alternative might be to allow a stubFactory to be passed in, which effectively replaces noop with a call to stubFactory()... That could make it particularly easy to stub stuff out but it might just overcomplicate things too.
I'm not sure how optional dependencies
package.json
work, but I thought it might be useful to have thenoop
s besinon.spy
/sinon.stub
instances ifsinon
is available as an optional peer dependency, as that makes them real easy to bust up in tests. But there's also nothing preventing anyone from just overridding thenoop
s with custom stubs of their own choosing, so I guess it's NBD really...Well, I guess one alternative might be to allow a
stubFactory
to be passed in, which effectively replacesnoop
with a call tostubFactory()
... That could make it particularly easy to stub stuff out but it might just overcomplicate things too.