Skip to content

Commit bab01ea

Browse files
committed
Add missing integeration test for date type parser.
We don't parse date types in the javascript binary parser. Keep this in mind if you plan to use the binary javascript parser.
1 parent 85829a9 commit bab01ea

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/integration/client/type-coercion-tests.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,18 @@ helper.pg.connect(helper.config, assert.calls(function(err, client) {
145145
sink.add();
146146
})
147147
}))
148+
149+
if(!helper.config.binary) {
150+
test("postgres date type", function() {
151+
var client = helper.client();
152+
client.on('error', function(err) {
153+
console.log(err);
154+
client.end();
155+
});
156+
client.query("SELECT '2010-10-31'::date", assert.calls(function(err, result){
157+
assert.isNull(err);
158+
assert.UTCDate(result.rows[0].date, 2010, 9, 31, 0, 0, 0, 0);
159+
}));
160+
client.on('drain', client.end.bind(client));
161+
});
162+
}

0 commit comments

Comments
 (0)