node-postgres/test/api-tests.js
2010-09-29 01:01:52 -05:00

27 lines
537 B
JavaScript

require(__dirname+"/test-helper");
//defaults
var client = new Client();
assert.equal(client.user, null);
assert.equal(client.database, null);
assert.equal(client.port, 5432);
var user = 'brian';
var database = 'hello';
var client = new Client({
user: 'briancarlson',
database: 'hello',
port: 321
});
assert.equal(client.user, 'briancarlson');
assert.equal(client.database, 'hello');
assert.equal(client.port, 321);
client.port = 5432;
client.connect();
var query = client.query('create temporary table bang (id integer)');