Add CLI and infra test coverage

This commit is contained in:
Peter Steinberger
2025-11-25 12:28:00 +01:00
parent ca48350a45
commit ff6e13d274
11 changed files with 451 additions and 0 deletions

16
src/cli/wait.test.ts Normal file
View File

@@ -0,0 +1,16 @@
import { describe, expect, it, vi } from "vitest";
import { waitForever } from "./wait.js";
describe("waitForever", () => {
it("creates an unref'ed interval and returns a pending promise", () => {
const setIntervalSpy = vi.spyOn(global, "setInterval");
const promise = waitForever();
expect(setIntervalSpy).toHaveBeenCalledWith(
expect.any(Function),
1_000_000,
);
expect(promise).toBeInstanceOf(Promise);
setIntervalSpy.mockRestore();
});
});