fix tests

This commit is contained in:
Andrey Sidorov 2014-03-08 18:04:28 +11:00
parent 56001da581
commit 75ad329b4f
2 changed files with 8 additions and 2 deletions

View file

@ -52,9 +52,16 @@ describe('Client', function() {
});
it('returns error when connecting to non existent display', function(done) {
var errorCbCalled = false;
var client = x11.createClient({ display : ':44' }, function(err, display) {
assert(util.isError(err));
errorCbCalled = true;
done();
});
// TODO: stop writing to socket after first error
client.on('error', function() {
if (!errorCbCalled)
done('should not reach here before first done()');
});
});
});

View file

@ -6,7 +6,7 @@ describe('Client', function() {
var display;
beforeEach(function(done) {
var client = x11.createClient(function(err, dpy) {
var client = x11.createClient({ debug: true }, function(err, dpy) {
console.log(err)
display = dpy;
done(err);
@ -14,7 +14,6 @@ describe('Client', function() {
});
it('should emit error which is instance of Error with sequence number corresponding to source request', function(done) {
display.client.options.debug = true;
display.client.CreateWindow(); // should emit error
var seq = display.client.seq_num;
display.client.once('error', function(err) {