From e37da08730133f9f7280ee88fb8202b8112f0558 Mon Sep 17 00:00:00 2001
From: Travis Ralston <travpc@gmail.com>
Date: Wed, 15 Jan 2020 14:06:24 -0700
Subject: [PATCH] Replace beforeEach with just a cleanLocalstorage call

The rest isn't needed anymore.
---
 test/app-tests/loading-test.js |  2 ++
 test/test-utils.js             | 25 +------------------------
 2 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/test/app-tests/loading-test.js b/test/app-tests/loading-test.js
index 2a86368f..462b85ce 100644
--- a/test/app-tests/loading-test.js
+++ b/test/app-tests/loading-test.js
@@ -37,6 +37,7 @@ import {makeType} from "matrix-react-sdk/src/utils/TypeUtils";
 import {ValidatedServerConfig} from "matrix-react-sdk/src/utils/AutoDiscoveryUtils";
 import {sleep} from "../test-utils";
 import "fake-indexeddb/auto";
+import {cleanLocalstorage} from "../test-utils";
 
 const DEFAULT_HS_URL='http://my_server';
 const DEFAULT_IS_URL='http://my_is';
@@ -86,6 +87,7 @@ describe('loading:', function() {
             test_utils.deleteIndexedDB('matrix-js-sdk:crypto'),
             test_utils.deleteIndexedDB('matrix-js-sdk:riot-web-sync'),
         ]);
+        cleanLocalstorage();
         console.log(`${Date.now()}: loading: afterEach complete`);
     });
 
diff --git a/test/test-utils.js b/test/test-utils.js
index 880dd772..734f9606 100644
--- a/test/test-utils.js
+++ b/test/test-utils.js
@@ -1,30 +1,7 @@
-"use strict";
-
-/**
- * Perform common actions before each test case, e.g. printing the test case
- * name to stdout.
- * @param {Mocha.Context} context  The test context
- */
-export function beforeEach(context) {
-    const desc = context.currentTest.fullTitle();
-    console.log();
-    console.log(desc);
-    console.log(new Array(1 + desc.length).join("="));
-
-    // some tests store things in localstorage. Improve independence of tests
-    // by making sure that they don't inherit any old state.
+export function cleanLocalstorage() {
     window.localStorage.clear();
 }
 
-/**
- * returns true if the current environment supports webrtc
- */
-export function browserSupportsWebRTC() {
-    const n = global.window.navigator;
-    return n.getUserMedia || n.webkitGetUserMedia ||
-        n.mozGetUserMedia;
-}
-
 export function deleteIndexedDB(dbName) {
     return new Promise((resolve, reject) => {
         if (!window.indexedDB) {