Skip to content

Commit

Permalink
Add test for date type (#3261)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianc authored Jun 19, 2024
1 parent 83a0e3e commit 53dc4e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/pg/test/integration/client/timezone-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ pool.connect(function (err, client, done) {
})
})

suite.testAsync('date comes out as a date', async function () {
const { rows } = await client.query('SELECT NOW()::DATE AS date')
assert(rows[0].date instanceof Date)
})

suite.test('timestamp with time zone', function (cb) {
client.query('SELECT CAST($1 AS TIMESTAMP WITH TIME ZONE) AS "val"', [date], function (err, result) {
assert(!err)
Expand Down

0 comments on commit 53dc4e6

Please sign in to comment.