Fix test for deleteUser
This commit is contained in:
1 parent
18081ceb77
commit
73dcc3f4ed
1 file changed
+2
-2
@@ -812,9 +812,9 @@ describe("Auth Controller - deleteUser", () => {
|
|||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
sinon.restore();
|
sinon.restore();
|
||||||
});
|
});
|
||||||
it("should return 404 if user is not found", async () => {
|
it("should throw an error if user is not found", async () => {
|
||||||
jwt.decode.returns({ email: "test@example.com" });
|
jwt.decode.returns({ email: "test@example.com" });
|
||||||
req.db.getUserByEmail.resolves(null);
|
req.db.getUserByEmail.throws(new Error(errorMessages.DB_USER_NOT_FOUND));
|
||||||
|
|
||||||
await deleteUser(req, res, next);
|
await deleteUser(req, res, next);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user