test: cover message query pagination
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import {
|
import {
|
||||||
decodeCursor,
|
decodeCursor,
|
||||||
encodeCursor,
|
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 () => {
|
afterAll(async () => {
|
||||||
try {
|
try {
|
||||||
await closeDatabase();
|
await closeDatabase();
|
||||||
|
|||||||
Reference in New Issue
Block a user