Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 4f7d6ae

Browse files
committed
fix: correct test relaying on jasmine timeout
The tests run slow, because afterEach was async but never called done(). because it was afterEach any errors are ignored and so it did not show up as failure. Instead the test ran very slow until jasmine timed out. This fix corrects the afterEach and decreases the timeout to 1,000 ms.
1 parent a9ad9eb commit 4f7d6ae

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: test/patch/WebSocket.spec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe('WebSocket', ifEnvSupports('WebSocket', function () {
2020
afterEach(function (done) {
2121
socket.addEventListener('close', done);
2222
socket.close();
23+
done();
2324
});
2425

2526

@@ -102,6 +103,6 @@ describe('WebSocket', ifEnvSupports('WebSocket', function () {
102103
setTimeout(function() {
103104
expect(log).toEqual('');
104105
done();
105-
}, 500);
106+
}, 100);
106107
});
107108
}));

Diff for: test/setup.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 2000;
2+
13
// Setup tests for Zone without microtask support
24
require('../lib/browser/zone.js');
35
require('../lib/browser/long-stack-trace-zone.js');

0 commit comments

Comments
 (0)