Skip to content

Commit

Permalink
EventEmitter issue example
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheworiordan committed Feb 18, 2015
1 parent 548c9ba commit 93e3c4a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions spec/realtime/event_emitter.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use strict";

define(['ably', 'shared_helper'], function(Ably, helper) {
beforeAll(helper.setupApp);
afterAll(helper.tearDownApp);

describe('Realtime EventEmitter', function() {
it('swallows exceptions, does not log the error, and leaves the suite hanging on failure waiting for a timeout', function(done) {
var realtime = helper.AblyRealtime({ key: 1 });
var channel = realtime.channels.get('doesNotHavePermission');

channel.attach(function(err) {
if (err) {
console.log(err);
assert(false, 'failed');
}
assert.ok(true, 'passed');
done();
});
}, 5000);
});

describe('Test suite behaviour', function() {
it('stops immediately when an exception is raised in an async block', function(done) {
setTimeout(function() {
assert(false, 'failed');
}, 1000);
}, 5000);
});
});

0 comments on commit 93e3c4a

Please sign in to comment.