MCPcopy
hub / github.com/philc/vimium / stubPostMessage

Function stubPostMessage

tests/unit_tests/ui_component_test.js:6–13  ·  view source on GitHub ↗
(iframeEl, fn)

Source from the content-addressed store, hash-verified

4import "../../content_scripts/ui_component.js";
5
6function stubPostMessage(iframeEl, fn) {
7 if (!iframeEl || !fn) throw new Error("iframeEl and fn are required.");
8 Object.defineProperty(iframeEl, "contentWindow", {
9 value: { postMessage: fn },
10 writable: false,
11 configurable: true,
12 });
13}
14
15context("UIComponent", () => {
16 let c;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected