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

Commit

Permalink
fix: correct test relaying on jasmine timeout
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mhevery committed Dec 16, 2015
1 parent a9ad9eb commit 4f7d6ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/patch/WebSocket.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('WebSocket', ifEnvSupports('WebSocket', function () {
afterEach(function (done) {
socket.addEventListener('close', done);
socket.close();
done();
});


Expand Down Expand Up @@ -102,6 +103,6 @@ describe('WebSocket', ifEnvSupports('WebSocket', function () {
setTimeout(function() {
expect(log).toEqual('');
done();
}, 500);
}, 100);
});
}));
2 changes: 2 additions & 0 deletions test/setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
jasmine.DEFAULT_TIMEOUT_INTERVAL = 2000;

// Setup tests for Zone without microtask support
require('../lib/browser/zone.js');
require('../lib/browser/long-stack-trace-zone.js');
Expand Down

0 comments on commit 4f7d6ae

Please sign in to comment.