Add test for pg.types interface

This commit is contained in:
Brian M. Carlson 2014-03-15 15:41:36 -05:00
parent 876abe8730
commit 0254fa565f
2 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,7 @@ var PG = function(clientConstructor) {
this.Query = this.Client.Query; this.Query = this.Client.Query;
this.pools = pool; this.pools = pool;
this.Connection = Connection; this.Connection = Connection;
this.types = require('pg-types');
}; };
util.inherits(PG, EventEmitter); util.inherits(PG, EventEmitter);

View File

@ -2,6 +2,14 @@ require(__dirname + '/test-helper');
var utils = require(__dirname + "/../../lib/utils"); var utils = require(__dirname + "/../../lib/utils");
var defaults = require(__dirname + "/../../lib").defaults; var defaults = require(__dirname + "/../../lib").defaults;
test('ensure types is exported on root object', function() {
var pg = require('../../lib')
assert(pg.types)
assert(pg.types.getTypeParser)
assert(pg.types.setTypeParser)
})
//this tests the monkey patching //this tests the monkey patching
//to ensure comptability with older //to ensure comptability with older
//versions of node //versions of node