mirror of
https://github.com/danbulant/node-x11
synced 2026-05-20 04:48:56 +00:00
- The new signature is:
createClient(options, initCB), where
- options is an optional object that defines different parameters such as
display, etc.
- initCB is an optional callback with the signature: function(err, display)
- The initCB is going to be called with an error ONLY if the connection to the X
server fails. Further errors in the server connection will be 'emitted'.
- Update tests and test-runner.js accordingly.
- Update README.
31 lines
952 B
JavaScript
31 lines
952 B
JavaScript
var x11 = require('../lib/x11');
|
|
var should = require('should');
|
|
var assert = require('assert');
|
|
|
|
describe('Client', function() {
|
|
|
|
var display;
|
|
beforeEach(function(done) {
|
|
var client = x11.createClient(function(err, dpy) {
|
|
console.log(err)
|
|
display = dpy;
|
|
done(err);
|
|
});
|
|
});
|
|
|
|
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) {
|
|
assert.equal(err.constructor, Error);
|
|
assert.equal(seq, err.seq);
|
|
display.client.CreateWindow(); // should emit error
|
|
seq = display.client.seq_num;
|
|
display.client.once('error', function(err) {
|
|
assert.equal(seq, err.seq);
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
});
|