test: isolate module mocking and add sequential test script
This commit is contained in:
+5
-2
@@ -1,5 +1,4 @@
|
||||
import { describe, it, expect, mock, spyOn, beforeEach, afterEach } from "bun:test";
|
||||
import logger from "../src/utils/logger.js";
|
||||
import { describe, it, expect, mock, beforeEach, afterAll } from "bun:test";
|
||||
|
||||
// Mock db
|
||||
const mockInsert = mock(() => ({
|
||||
@@ -116,4 +115,8 @@ describe("Upload Route Handler", () => {
|
||||
expect(body.public_id).toBe("mocked-nanoid-id");
|
||||
expect(body.file_name).toBe("test_multi.txt");
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
mock.restore();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user