mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test: dedupe plugin cli mock reads
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user