node-postgres/test/unit/client-tests.js

28 lines
573 B
JavaScript
Raw Normal View History

2010-10-03 13:27:16 +08:00
require(__dirname+'/test-helper');
2010-10-11 11:42:13 +08:00
2010-10-03 13:27:16 +08:00
test('client settings', function() {
2010-10-11 11:42:13 +08:00
2010-10-03 13:27:16 +08:00
test('defaults', function() {
var client = new Client();
assert.equal(client.user, null);
assert.equal(client.database, null);
assert.equal(client.port, 5432);
});
test('custom', function() {
var user = 'brian';
var database = 'pgjstest';
var client = new Client({
user: user,
database: database,
port: 321
});
assert.equal(client.user, user);
assert.equal(client.database, database);
assert.equal(client.port, 321);
});
});