Skip to content

Commit 0254fa5

Browse files
committed
Add test for pg.types interface
1 parent 876abe8 commit 0254fa5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var PG = function(clientConstructor) {
1212
this.Query = this.Client.Query;
1313
this.pools = pool;
1414
this.Connection = Connection;
15+
this.types = require('pg-types');
1516
};
1617

1718
util.inherits(PG, EventEmitter);

test/unit/utils-tests.js

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ require(__dirname + '/test-helper');
22
var utils = require(__dirname + "/../../lib/utils");
33
var defaults = require(__dirname + "/../../lib").defaults;
44

5+
6+
test('ensure types is exported on root object', function() {
7+
var pg = require('../../lib')
8+
assert(pg.types)
9+
assert(pg.types.getTypeParser)
10+
assert(pg.types.setTypeParser)
11+
})
12+
513
//this tests the monkey patching
614
//to ensure comptability with older
715
//versions of node

0 commit comments

Comments
 (0)