remove.test.ts•689 B
/** Unit test for removeAction */
import { Command } from "commander";
import { beforeEach, describe, expect, it, vi } from "vitest";
const removeFn = vi.fn(async () => {});
vi.mock("../../store", () => ({
createDocumentManagement: vi.fn(async () => ({
shutdown: vi.fn(),
removeAllDocuments: removeFn,
})),
}));
import { removeAction } from "./remove";
function _cmd() {
return new Command();
}
beforeEach(() => {
vi.clearAllMocks();
});
describe("removeAction", () => {
it("calls removeAllDocuments", async () => {
await removeAction("react", { version: "18.0.0", serverUrl: undefined });
expect(removeFn).toHaveBeenCalledWith("react", "18.0.0");
});
});