Skip to content

Commit 244265d

Browse files
committed
Make sure that we clear localstorage before *all* tests
This was causing flaky tests, as sometimes the joining test would inherit an "mx_is_guest" setting from a previous test run.
1 parent ab93e96 commit 244265d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎test/app-tests/loading.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ describe('loading:', function () {
5959

6060
windowLocation = null;
6161
matrixChat = null;
62-
63-
window.localStorage.clear();
6462
});
6563

6664
afterEach(function() {

‎test/test-utils.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ module.exports.beforeEach = function(context) {
1212
console.log();
1313
console.log(desc);
1414
console.log(new Array(1 + desc.length).join("="));
15+
16+
// some tests store things in localstorage. Improve independence of tests
17+
// by making sure that they don't inherit any old state.
18+
window.localStorage.clear();
1519
};
1620

1721
/**

0 commit comments

Comments
 (0)