mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 00:31:24 +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 path from "node:path";
|
||||
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()}`);
|
||||
let tempDirIndex = 0;
|
||||
@@ -296,3 +297,13 @@ describe("installHooksFromNpmSpec", () => {
|
||||
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