From 4e20258caf91dfe348740b8b6dc23d03999fd3f3 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Thu, 2 Nov 2023 16:10:29 +0100 Subject: [PATCH] Undo changes to server --- tests/e2e/server/index.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/tests/e2e/server/index.js b/tests/e2e/server/index.js index 728e53e8558c..3910ef43f798 100644 --- a/tests/e2e/server/index.js +++ b/tests/e2e/server/index.js @@ -77,23 +77,10 @@ const createListenerState = () => { * * It returns an instance to which you can add listeners for the test results, and test done events. */ - -const doneListeners = []; - -function addTestDoneListener(listener) { - doneListeners.push(listener); - - return () => { - const index = doneListeners.indexOf(listener); - if (index !== -1) { - doneListeners.splice(index, 1); - } - }; -} - const createServerInstance = () => { const [testStartedListeners, addTestStartedListener] = createListenerState(); const [testResultListeners, addTestResultListener] = createListenerState(); + const [testDoneListeners, addTestDoneListener] = createListenerState(); let activeTestConfig; @@ -132,7 +119,7 @@ const createServerInstance = () => { } case Routes.testDone: { - doneListeners.forEach((listener) => { + testDoneListeners.forEach((listener) => { listener(); }); return res.end('ok');