Skip to content

Commit

Permalink
Undo changes to server
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Nov 2, 2023
1 parent 1f28c56 commit 4e20258
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions tests/e2e/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -132,7 +119,7 @@ const createServerInstance = () => {
}

case Routes.testDone: {
doneListeners.forEach((listener) => {
testDoneListeners.forEach((listener) => {
listener();
});
return res.end('ok');
Expand Down

0 comments on commit 4e20258

Please sign in to comment.