From 298fc968cf4c69d9a32e151e084e014f8dc03a5a Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Thu, 14 May 2026 19:01:01 +0700 Subject: [PATCH] test: cover message query pagination --- tests/moderation/messageStoreQueries.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/moderation/messageStoreQueries.test.ts b/tests/moderation/messageStoreQueries.test.ts index 46555d6..91a433c 100644 --- a/tests/moderation/messageStoreQueries.test.ts +++ b/tests/moderation/messageStoreQueries.test.ts @@ -1,4 +1,4 @@ -import { afterAll, beforeAll, describe, expect, it } from "vitest"; +import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { decodeCursor, encodeCursor, @@ -61,6 +61,16 @@ describe("message query integration tests", () => { } }); + beforeEach(async () => { + // Clear messages table before each test + try { + const db = getDatabase() as any; + await db.run(`DELETE FROM "messages"`); + } catch (error) { + logger.debug("Could not clear messages table", { error }); + } + }); + afterAll(async () => { try { await closeDatabase();