TypeError: stub expected to yield, but no callback was passed returned from unit test TypeError: stub expected to yield, but no callback was passed returned from unit test mongoose mongoose

TypeError: stub expected to yield, but no callback was passed returned from unit test


In case someone ever runs into this (most likely future me).

I managed to solve my issue. I was using promises in my code and should have set up my mock accordingly (also chaining correctly).

MyModelMock.expects('find').chain('where').chain('in').chain('exec').resolves(set);