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

    Function createMockWebview

    • Creates the extension-host half of a webview. HTML and options are mutable, messages are recordable/fireable, and URIs get recognizable mock text. No browser executes the HTML and no CSP or origin boundary is enforced.

      Parameters

      Returns {
          _fireMessage: (message: unknown) => void;
          asWebviewUri: MockFn<
              [uri: { toString: () => string }],
              { fsPath: string; scheme: string; toString: () => string },
          >;
          cspSource: string;
          html: string;
          onDidReceiveMessage: MockFn<
              [listener: (message: unknown) => void],
              { dispose: MockFn<[], void> },
          >;
          options: {};
          postMessage: MockFn<unknown[], unknown>;
      }

      • _fireMessage: (message: unknown) => void

        Test hook: simulates the webview content posting message back to the extension host.

      • asWebviewUri: MockFn<
            [uri: { toString: () => string }],
            { fsPath: string; scheme: string; toString: () => string },
        >
      • cspSource: string
      • html: string
      • onDidReceiveMessage: MockFn<[listener: (message: unknown) => void], { dispose: MockFn<[], void> }>
      • options: {}
      • postMessage: MockFn<unknown[], unknown>