test: dedupe plugin cli mock reads

This commit is contained in:
Peter Steinberger
2026-05-13 06:13:46 +01:00
parent 0b0539af17
commit 6715ac526e
2 changed files with 2 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ describe("plugins cli list", () => {
await runPluginsCommand(["plugins", "list", "--json"]);
expect(buildPluginRegistrySnapshotReport).toHaveBeenCalledTimes(1);
const [reportOptions] = buildPluginRegistrySnapshotReport.mock.calls.at(0) as [
const [reportOptions] = buildPluginRegistrySnapshotReport.mock.calls[0] as [
{
config?: unknown;
logger?: { info?: unknown; warn?: unknown; error?: unknown };

View File

@@ -47,7 +47,7 @@ function expectRestartNoticeLogged() {
function expectSingleCallParams(mockFn: ReturnType<typeof vi.fn>) {
expect(mockFn).toHaveBeenCalledTimes(1);
const params = mockFn.mock.calls.at(0)?.[0] as Record<string, unknown> | undefined;
const params = mockFn.mock.calls[0]?.[0] as Record<string, unknown> | undefined;
if (params === undefined) {
throw new Error("expected call params");
}