k88hudson / react-router-stub

Utility for stubbing/testing code using react router
1 stars 2 forks source link

Make the stub optionally use sinon? #1

Open toolness opened 9 years ago

toolness commented 9 years ago

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.

k88hudson commented 9 years ago

oh yeah, that seems like a good idea