test: isolate module mocking and add sequential test script
This commit is contained in:
+5
-1
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, mock, spyOn, beforeEach } from "bun:test";
|
||||
import { describe, it, expect, mock, spyOn, beforeEach, afterAll } from "bun:test";
|
||||
import logger from "../src/utils/logger.js";
|
||||
|
||||
// Mock environment
|
||||
@@ -145,4 +145,8 @@ describe("Telegram Bot Handler", () => {
|
||||
expect(mockForwardToStorage).not.toHaveBeenCalled();
|
||||
expect(replyMock).toHaveBeenCalledWith(expect.stringContaining("exceeds"));
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
mock.restore();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user