test: isolate module mocking and add sequential test script

This commit is contained in:
MythEclipse
2026-05-18 07:16:30 +07:00
parent 434905313c
commit 252b2e4a1f
4 changed files with 17 additions and 6 deletions
+5 -2
View File
@@ -1,5 +1,4 @@
import { describe, it, expect, mock, spyOn, beforeEach } from "bun:test";
import logger from "../src/utils/logger.js";
import { describe, it, expect, mock, beforeEach, afterAll } from "bun:test";
// Mock database layer
const mockSelect = mock(() => ({
@@ -176,4 +175,8 @@ describe("File Route Handlers", () => {
expect(body.error).toBe("Server error");
});
});
afterAll(() => {
mock.restore();
});
});