4 ms·
Why (no pun intended) should I use this over sinon?
by tieTYT 13y ago
Why (no pun intended) should I use this over sinon?
- lucaspiller 13y agoI should probably add that to the readme: I was using Sinon for other stuff (mainly the spies to check stuff is called), and wanted to mock a call to X.Y.Z. This was an external component with it's own tests, so for test isolation it wasn't included in the environment for this test - as such X.Y and X.Y.Z didn't exist. Sinon has the mock function, but you can't call it on stuff that doesn't exist. I guess you could stub X to include Y then stub that to include Z but it seems a bit overkill. Also coming from a Ruby background I'm not a fan of Sinon's quite verbose syntax. So I quickly whipped this up to do what I wanted :)