From 0254fa565f21199ec5519be8523ded32cc62fb74 Mon Sep 17 00:00:00 2001 From: "Brian M. Carlson" Date: Sat, 15 Mar 2014 15:41:36 -0500 Subject: [PATCH] Add test for pg.types interface --- lib/index.js | 1 + test/unit/utils-tests.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/index.js b/lib/index.js index 0cad644..3d7aa58 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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); diff --git a/test/unit/utils-tests.js b/test/unit/utils-tests.js index 660afbf..56c81dc 100644 --- a/test/unit/utils-tests.js +++ b/test/unit/utils-tests.js @@ -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