mirror of https://github.com/openclaw/openclaw.git
test: dedupe synology chat client timer setup
This commit is contained in:
parent
853999fd7f
commit
b9f0effd55
|
|
@ -51,7 +51,7 @@ function mockFailureResponse(statusCode = 500) {
|
|||
mockResponse(statusCode, "error");
|
||||
}
|
||||
|
||||
describe("sendMessage", () => {
|
||||
function installFakeTimerHarness() {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
vi.useFakeTimers();
|
||||
|
|
@ -62,6 +62,10 @@ describe("sendMessage", () => {
|
|||
afterEach(() => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
}
|
||||
|
||||
describe("sendMessage", () => {
|
||||
installFakeTimerHarness();
|
||||
|
||||
it("returns true on successful send", async () => {
|
||||
mockSuccessResponse();
|
||||
|
|
@ -86,16 +90,7 @@ describe("sendMessage", () => {
|
|||
});
|
||||
|
||||
describe("sendFileUrl", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
vi.useFakeTimers();
|
||||
fakeNowMs += 10_000;
|
||||
vi.setSystemTime(fakeNowMs);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
installFakeTimerHarness();
|
||||
|
||||
it("returns true on success", async () => {
|
||||
mockSuccessResponse();
|
||||
|
|
|
|||
Loading…
Reference in New Issue