1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-10 21:23:02 +03:00

Clean up test shutdown

Make sure that the integration tests actually kill off all of their timers, so
that jasmine exits cleanly.

This probably also fixes https://github.com/vector-im/vector-web/issues/1365.
This commit is contained in:
Richard van der Hoff
2016-04-14 12:01:23 +01:00
parent 0282021e09
commit 3404751eb9
8 changed files with 46 additions and 16 deletions

View File

@@ -15,6 +15,19 @@ function HttpBackend() {
realReq.callback = callback;
console.log("HTTP backend received request: %s %s", opts.method, opts.uri);
self.requests.push(realReq);
var abort = function() {
var idx = self.requests.indexOf(realReq);
if (idx >= 0) {
console.log("Aborting HTTP request: %s %s", opts.method,
opts.uri);
self.requests.splice(idx, 1);
realReq.callback("aborted");
}
}
return {
abort: abort
};
};
}
HttpBackend.prototype = {