Add CLI and infra test coverage
This commit is contained in:
16
src/cli/wait.test.ts
Normal file
16
src/cli/wait.test.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user