-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai-spies": "^0.7.1",
Hi there,
I am testing a little ORM I created myself
I am having some problems testing the result of a spy on a promise, the test always passes, no matter what I put inside with, in the example below I just put null, although query should be called with a SELECT SQL sentence
Any suggestions?
it('test SQL',
() => {
Item.database = { query: queryReturnsInsert };
const item = new Item();
item.name = 'James';
const spy = chai.spy.on(Item.database, 'query');
item.save({ in: 'go' })
.then(function() {
expect(spy).to.have.been.called.with(null);
});
});Metadata
Metadata
Assignees
Labels
No labels