Mockery and Sinon

42 views
Skip to first unread message

Unai Orbe

unread,
Mar 30, 2013, 4:28:28 PM3/30/13
to sin...@googlegroups.com
Hello everyone,

I'm trying to use sinon with mockery[1] (to substitute actual node modules with my mocks) and I'm experiencing some weirdness.

Most of my mocks (there is one that seems to work) say they are not called (called is false, callCount 0), but I know those mocked functions are being called because  I pretty much removed all the code except the function calls to force it to be called. Mockery doesn't seem to be reporting any errors and the mocks seem to be registering properly, if I print the mocked function on the code I'm trying to test, the object that gets printed is a sinon stub, so all I can think of right now is that sinon might be malfunctioning with mockery.

I'm wondering if someone has used sinon with mockery before and experienced this sort of issues. Did someone get sinon working with mockery?

Thanks!


--
Unai Orbe

Unai

unread,
Apr 6, 2013, 5:49:35 AM4/6/13
to sin...@googlegroups.com

Turns out the problem was definitely not on sinon, I was using mocha.js with a beforeEach block and changing that to a before solves my issue, so I must have misunderstood something on mocha's usage. I'm asking on mocha's google group for someone to explain the difference between those two blocks to me, but I just wanted to leave a note here in case someone thought there is a weird bug on sinon :-P.
Reply all
Reply to author
Forward
0 new messages