add MessageChannel mock to grafana-plugin-configs

This commit is contained in:
Ashley Harrison
2025-12-16 12:04:11 +00:00
parent 7a1938c23b
commit f2cb70b1e0
@@ -84,3 +84,19 @@ global.ResizeObserver = class ResizeObserver {
this.#isObserving = false;
}
};
global.MessageChannel = jest.fn().mockImplementation(() => {
let onmessage;
return {
port1: {
set onmessage(cb) {
onmessage = cb;
},
},
port2: {
postMessage: (data) => {
onmessage?.({ data });
},
},
};
});