File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {makeType} from "matrix-react-sdk/src/utils/TypeUtils";
3737import { ValidatedServerConfig } from "matrix-react-sdk/src/utils/AutoDiscoveryUtils" ;
3838import { sleep } from "../test-utils" ;
3939import "fake-indexeddb/auto" ;
40+ import { cleanLocalstorage } from "../test-utils" ;
4041
4142const DEFAULT_HS_URL = 'http://my_server' ;
4243const DEFAULT_IS_URL = 'http://my_is' ;
@@ -86,6 +87,7 @@ describe('loading:', function() {
8687 test_utils . deleteIndexedDB ( 'matrix-js-sdk:crypto' ) ,
8788 test_utils . deleteIndexedDB ( 'matrix-js-sdk:riot-web-sync' ) ,
8889 ] ) ;
90+ cleanLocalstorage ( ) ;
8991 console . log ( `${ Date . now ( ) } : loading: afterEach complete` ) ;
9092 } ) ;
9193
Original file line number Diff line number Diff line change 1- "use strict" ;
2-
3- /**
4- * Perform common actions before each test case, e.g. printing the test case
5- * name to stdout.
6- * @param {Mocha.Context } context The test context
7- */
8- export function beforeEach ( context ) {
9- const desc = context . currentTest . fullTitle ( ) ;
10- console . log ( ) ;
11- console . log ( desc ) ;
12- console . log ( new Array ( 1 + desc . length ) . join ( "=" ) ) ;
13-
14- // some tests store things in localstorage. Improve independence of tests
15- // by making sure that they don't inherit any old state.
1+ export function cleanLocalstorage ( ) {
162 window . localStorage . clear ( ) ;
173}
184
19- /**
20- * returns true if the current environment supports webrtc
21- */
22- export function browserSupportsWebRTC ( ) {
23- const n = global . window . navigator ;
24- return n . getUserMedia || n . webkitGetUserMedia ||
25- n . mozGetUserMedia ;
26- }
27-
285export function deleteIndexedDB ( dbName ) {
296 return new Promise ( ( resolve , reject ) => {
307 if ( ! window . indexedDB ) {
You can’t perform that action at this time.
0 commit comments