@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Variable commands

    commands: {
        executeCommand: MockFn<
            [commandId: string, ...args: unknown[]],
            Promise<unknown>,
        >;
        registerCommand: MockFn<
            [commandId: string, callback: (...args: unknown[]) => unknown],
            { _callback: (...args: unknown[]) => unknown; dispose: MockFn<[], void> },
        >;
        registerTextEditorCommand: MockFn<
            [
                commandId: string,
                callback: (editor: unknown, edit: unknown, ...args: unknown[]) => unknown,
            ],
            {
                _callback: (
                    editor: unknown,
                    edit: unknown,
                    ...args: unknown[],
                ) => unknown;
                dispose: MockFn<[], void>;
            },
        >;
    }

    Type Declaration

    • executeCommand: MockFn<[commandId: string, ...args: unknown[]], Promise<unknown>>

      Dispatches to a registered handler, and rejects for an unknown id.

      setContext is the exception, and the only one. It is a VS Code built-in that no extension registers, so rejecting it would be the mock lying about the platform — and an extension mirroring a setting into a when clause is a common enough shape that every one of them would have to work around it. Other built-ins are left rejecting on purpose: they have effects a mock cannot stand in for, and silently resolving undefined would hide a test that never did what it claimed. The call is still recorded, so mock.calls is how a test asserts the key was published.

    • registerCommand: MockFn<
          [commandId: string, callback: (...args: unknown[]) => unknown],
          { _callback: (...args: unknown[]) => unknown; dispose: MockFn<[], void> },
      >
    • registerTextEditorCommand: MockFn<
          [
              commandId: string,
              callback: (editor: unknown, edit: unknown, ...args: unknown[]) => unknown,
          ],
          {
              _callback: (
                  editor: unknown,
                  edit: unknown,
                  ...args: unknown[],
              ) => unknown;
              dispose: MockFn<[], void>;
          },
      >