Skip to content
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.

Factory syntax sometimes does not work correctly #18

Open
brent-hoover opened this issue Jun 13, 2016 · 0 comments
Open

Factory syntax sometimes does not work correctly #18

brent-hoover opened this issue Jun 13, 2016 · 0 comments

Comments

@brent-hoover
Copy link

It's possible (likely?) that I am doing something wrong but when I try to use this syntax:

stubs.create("mySpecialFunction", SomeObject, "someMethod");
stubs.mySpecialFunction.returns(function () {
   console.log("do something")
}

The function is never called. But if I do:

let resetStub = sinon.stub(SomeObject "someMethod", function () {
    check(arguments, [Match.Any]);
});

The function is called.

It's not a big deal because obviously I can just use the second form, but I did spend quite a while trying to figure out why the first form didn't work to no avail.

TIA

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant