diff --git a/test/customBoot.js b/test/customBoot.js index 0254412..8295642 100644 --- a/test/customBoot.js +++ b/test/customBoot.js @@ -67,7 +67,7 @@ window.addEventListener("load", () => { htmlReporter.initialize(); // Use messageProxy socket to request spec injection - window.sendMessage({ + messageProxy.sendMessage({ subject: "injectSpecs" }); }); diff --git a/test/messageProxy.js b/test/messageProxy.js index 97bd611..268f25e 100644 --- a/test/messageProxy.js +++ b/test/messageProxy.js @@ -3,8 +3,10 @@ // Create socket connection const socket = new WebSocket("ws://localhost:8080"); -window.sendMessage = (message) => { - socket.send(JSON.stringify(message)); +window.messageProxy = { + sendMessage (message) { + socket.send(JSON.stringify(message)); + } } const reporterMethods = [ @@ -21,7 +23,7 @@ const customReporter = {}; // Populate reporter methods for (const method of reporterMethods) { customReporter[method] = function (result) { - sendMessage({ + messageProxy.sendMessage({ subject: method , data: result });