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

Factory syntax sometimes does not work correctly #18

@brent-hoover

Description

@brent-hoover

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions