1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
954 B

14 years ago
var sys = require('sys'),
14 years ago
Client = require('../lib/xmpp-client').Client,
14 years ago
Jid = require('../lib/xmpp-client').Jid,
conf = require('./conf').conf;
14 years ago
exports.testJid = function(test) {
14 years ago
test.expect(4);
14 years ago
var j = new Jid('mathieu@gtalk.com');
14 years ago
//sys.debug(JSON.stringify(j));
test.equals('mathieu', j.node);
test.equals('gtalk.com', j.domain);
test.equals('node', j.resource);
14 years ago
j = new Jid('mathieu@jabber.org/machin');
//sys.debug(JSON.stringify(j));
test.equals('machin', j.resource);
14 years ago
test.done();
};
14 years ago
exports.testClientInit = function(test) {
14 years ago
var c = new Client('mathieu@gtalk.com', 'toto');
test.equals('gtalk.com', c.host);
test.done();
};
14 years ago
exports.testClient = function(test) {
test.expect(1);
var c = new Client(conf.jid, conf.password);
c.debug = true;
c.addListener('online', function() {
test.ok(true);
test.done();
});
};
if(module.id == '.') {
var testrunner = require('nodeunit').testrunner;
testrunner.run([__filename]);
14 years ago
}