マングースモデルコード> ( Issue ) Queryの新しいインスタンスを返します 物体。新しいquery インスタンスはexecにアクセスできます プロトタイプによるメソッド 。 (マングース3.8〜)
エラーを返したい場合は、次のように記述できます。
sinon.stub(mongoose.Query.prototype, "exec").yields({ name: "MongoError" }, null);
マングースモデルコード> ( Issue ) Queryの新しいインスタンスを返します 物体。新しいquery インスタンスはexecにアクセスできます プロトタイプによるメソッド 。 (マングース3.8〜)
エラーを返したい場合は、次のように記述できます。
sinon.stub(mongoose.Query.prototype, "exec").yields({ name: "MongoError" }, null);