MCPcopy
hub / github.com/webpack/webpack / expectMessage

Function expectMessage

test/hotCases/worker/move-between-runtime/index.js:9–15  ·  view source on GitHub ↗
(w, msg)

Source from the content-addressed store, hash-verified

7 });
8
9const expectMessage = (w, msg) =>
10 new Promise((resolve, reject) => {
11 w.onmessage = ({ data }) => {
12 if (data === msg) resolve();
13 else reject(new Error(data));
14 };
15 });
16
17const next = w => {
18 const p = expectMessage(w, "next");

Callers 1

nextFunction · 0.85

Calls 1

resolveFunction · 0.85

Tested by

no test coverage detected