From 839ea818385e2fe92f9588e971478cc33d9fce26 Mon Sep 17 00:00:00 2001 From: hensm Date: Sat, 12 Jan 2019 09:28:01 +0000 Subject: [PATCH] Namespace messageProxy (sendMessage) --- test/customBoot.js | 2 +- test/messageProxy.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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 });