fix: stop gmail watcher restart on bind error

This commit is contained in:
Peter Steinberger
2026-01-06 01:40:15 +00:00
parent 11a5495919
commit 55b33b4e69
3 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
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);
});
});