Error on stub sequelize.query.withArgs().

48 views
Skip to first unread message

Gustavo Borges

unread,
Sep 29, 2017, 1:24:27 PM9/29/17
to Sinon.JS
When I try do create this stub:

const queryStub = sinon.stub(sequelize, 'query');

and them I call:

queryStub('select * from users', { type: sequelize.QueryTypes.SELECT }).resolves([ myResultSet ]);

queryStub doesn't return the Promise.

But if a do this:

queryStub.resolves( [ myResultSet ] );

Promise was resolved successfully.

What it happens when calling .withArgs I got the error? I can't understand.


Reply all
Reply to author
Forward
0 new messages