Some more test fixes

- Fix error.js test.
- Make sure test_runner exits with the correct error code.
- Comment tests not implemented in core-properties.
This commit is contained in:
Santiago Gimeno 2014-03-11 17:57:29 +01:00
parent 7d23cbfb9e
commit b6a76b51d7
3 changed files with 22 additions and 18 deletions

View file

@ -102,8 +102,8 @@ x11.createClient(function(err, display) {
function() {
X.terminate();
X.on('end', function() {
mocha.run(function() {
process.exit();
mocha.run(function(failures) {
process.exit(failures);
});
});

View file

@ -82,8 +82,8 @@ describe('Window property', function() {
});
});
it('should exist in the ListProperties result after inserted');
it('should not exist after GetProperty with delete flag called');
// it('should exist in the ListProperties result after inserted');
// it('should not exist after GetProperty with delete flag called');
//it('should not exist after GetProperty with delete flag called', function(done) {
// done();
//});

View file

@ -5,26 +5,30 @@ var assert = require('assert');
describe('Client', function() {
var display;
beforeEach(function(done) {
var client = x11.createClient({ debug: true }, function(err, dpy) {
console.log(err)
before(function(done) {
var client = x11.createClient({ debug: false }, function(err, dpy) {
should.not.exist(err);
display = dpy;
done(err);
done();
});
});
it('should emit error which is instance of Error with sequence number corresponding to source request', function(done) {
var times = 0;
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) {
display.client.on('error', function(err) {
switch (++ times) {
case 11:
display.client.removeAllListeners('error');
done(1);
break;
default:
assert.equal(err.constructor, Error);
assert.equal(seq, err.seq);
done();
});
});
});
display.client.CreateWindow(); // should emit error
seq = display.client.seq_num;
}
});
});
});