Correctly restore MatrixClientPeg after each test case

This commit is contained in:
Richard van der Hoff 2016-04-07 16:47:17 +01:00
parent b64604964d
commit a2168efcda
3 changed files with 30 additions and 7 deletions

View file

@ -27,12 +27,19 @@ var test_utils = require('test-utils');
var mockclock = require('mock-clock');
describe('MessagePanel', function () {
var sandbox;
var clock = mockclock.clock();
var realSetTimeout = window.setTimeout;
var events = mkEvents();
beforeEach(function() {
test_utils.beforeEach(this);
sandbox = test_utils.stubClient(sandbox);
});
afterEach(function () {
clock.uninstall();
sandbox.restore();
});
function mkEvents() {