Skip to content

Commit

Permalink
Add test for pg.types interface
Browse files Browse the repository at this point in the history
  • Loading branch information
brianc committed Mar 15, 2014
1 parent 876abe8 commit 0254fa5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/index.js
Expand Up @@ -12,6 +12,7 @@ var PG = function(clientConstructor) {
this.Query = this.Client.Query;
this.pools = pool;
this.Connection = Connection;
this.types = require('pg-types');
};

util.inherits(PG, EventEmitter);
Expand Down
8 changes: 8 additions & 0 deletions test/unit/utils-tests.js
Expand Up @@ -2,6 +2,14 @@ require(__dirname + '/test-helper');
var utils = require(__dirname + "/../../lib/utils");
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
//to ensure comptability with older
//versions of node
Expand Down

0 comments on commit 0254fa5

Please sign in to comment.