📜  find(...).populate 不是函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:20.837000             🧑  作者: Mango

代码示例1
Normally this happens because you did not stub Populate.
Example: (in this example i added select , lean and exec too) pay attention to 
the order in your function.
it("Expect to return an success object", async () => {
    findStub.returns({
      populate: sandbox.stub().returns({
        select: sandbox.stub().returns({
          lean: sandbox.stub().returns({
            exec: () => fixture.Test,
          }),
        }),
      }),
    });