mirror of
https://github.com/danbulant/node-x11
synced 2026-06-14 04:01:10 +00:00
first integration test
This commit is contained in:
parent
b6a0ceff7f
commit
0fd0e4485a
3 changed files with 22 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ function XClient(stream, displayNum, screenNum)
|
|||
this.screenNum = screenNum;
|
||||
this.authHost = os.hostname();
|
||||
|
||||
pack_stream = new PackStream();
|
||||
var pack_stream = new PackStream();
|
||||
|
||||
// data received from stream is dispached to
|
||||
// read requests set by calls to .unpack and .unpackTo
|
||||
|
|
@ -381,6 +381,7 @@ module.exports.createClient = function(initCb, display, options)
|
|||
} else if(host == '127.0.0.1') //TODO check if it's consistent with xlib (DISPLAY=127.0.0.1:0 -> local unix socket or port 6000?)
|
||||
socketPath = '/tmp/.X11-unix/X' + displayNum;
|
||||
}
|
||||
//socketPath = '/tmp/.X11-unix/X' + displayNum;
|
||||
if(socketPath)
|
||||
{
|
||||
stream = net.createConnection(socketPath);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
"sinon": "*"
|
||||
}
|
||||
, "scripts": {
|
||||
"test": "mocha",
|
||||
"test": "mocha --globals 'r,i'",
|
||||
"prepublish" : "npm prune"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
19
test/connect.js
Normal file
19
test/connect.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
var x11 = require('../lib/x11');
|
||||
//var sinon = require('sinon');
|
||||
var should = require('should');
|
||||
|
||||
describe("Client", function() {
|
||||
|
||||
beforeEach(function() {
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
});
|
||||
|
||||
it("calls first createClient parameter with display object", function(done) {
|
||||
var client = x11.createClient(function(display) {
|
||||
should.exist(display);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue