Skip to content

Commit 53dc4e6

Browse files
authored
Add test for date type (brianc#3261)
1 parent 83a0e3e commit 53dc4e6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/pg/test/integration/client/timezone-tests.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ pool.connect(function (err, client, done) {
2020
})
2121
})
2222

23+
suite.testAsync('date comes out as a date', async function () {
24+
const { rows } = await client.query('SELECT NOW()::DATE AS date')
25+
assert(rows[0].date instanceof Date)
26+
})
27+
2328
suite.test('timestamp with time zone', function (cb) {
2429
client.query('SELECT CAST($1 AS TIMESTAMP WITH TIME ZONE) AS "val"', [date], function (err, result) {
2530
assert(!err)

0 commit comments

Comments
 (0)