mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 08:42:43 +00:00
perf(test): fold gmail watcher assertions into hooks install suite
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
|
||||||
import { isAddressInUseError } from "./gmail-watcher.js";
|
|
||||||
|
|
||||||
describe("gmail watcher", () => {
|
|
||||||
it("detects address already in use errors", () => {
|
|
||||||
expect(isAddressInUseError("listen tcp 127.0.0.1:8788: bind: address already in use")).toBe(
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
expect(isAddressInUseError("EADDRINUSE: address already in use")).toBe(true);
|
|
||||||
expect(isAddressInUseError("some other error")).toBe(false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -3,6 +3,7 @@ import fs from "node:fs";
|
|||||||
import os from "node:os";
|
import os from "node:os";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { afterAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
import { isAddressInUseError } from "./gmail-watcher.js";
|
||||||
|
|
||||||
const fixtureRoot = path.join(os.tmpdir(), `openclaw-hook-install-${randomUUID()}`);
|
const fixtureRoot = path.join(os.tmpdir(), `openclaw-hook-install-${randomUUID()}`);
|
||||||
let tempDirIndex = 0;
|
let tempDirIndex = 0;
|
||||||
@@ -296,3 +297,13 @@ describe("installHooksFromNpmSpec", () => {
|
|||||||
expect(result.error).toContain("unsupported npm spec");
|
expect(result.error).toContain("unsupported npm spec");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("gmail watcher", () => {
|
||||||
|
it("detects address already in use errors", () => {
|
||||||
|
expect(isAddressInUseError("listen tcp 127.0.0.1:8788: bind: address already in use")).toBe(
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
expect(isAddressInUseError("EADDRINUSE: address already in use")).toBe(true);
|
||||||
|
expect(isAddressInUseError("some other error")).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user