Skip to content

Commit

Permalink
🗝️ Fix Database Not Flushing Data Problem
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenttannos committed Dec 14, 2024
1 parent 0186ed5 commit 8b7abdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions backend/tests/helpers/reset-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ let redisClient = createClient({
export default async () => {
await redisClient.connect();
await prisma.user.deleteMany();
await prisma.society.deleteMany();
await prisma.event.deleteMany();
await prisma.keyword.deleteMany();
await redisClient.flushDb();
await redisClient.quit();
};
5 changes: 1 addition & 4 deletions backend/tests/userKeywords.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe("POST /user/keyword endpoint", () => {
text: "skibidi12",
});

console.log(keywordRes.body);
expect(keywordRes.status).toBe(200);

const res = await request(app)
Expand Down Expand Up @@ -82,7 +81,6 @@ describe("POST /user/keyword endpoint", () => {
.send({
keywordId: -230,
});
console.log(res.body);
expect(res.status).toBe(404);
expect(res.body.message).toBe("Invalid keyword.");
});
Expand Down Expand Up @@ -276,8 +274,7 @@ describe("/user/keywords endpoint", () => {
const res = await request(app)
.get("/user/keywords")
.set("Cookie", sessionID)
console.log(res.body);
expect(res.status).toBe(404);
expect(res.status).toBe(200);
expect(res.body.length).toBe(0);
});
});

0 comments on commit 8b7abdb

Please sign in to comment.