Skip to content

Commit d5a3ec3

Browse files
committed
Fix: Use valid timestamp for cross-realm date test
1 parent 9678518 commit d5a3ec3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/pg/test/integration/gh-issues/2862-tests.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ const suite = new helper.Suite()
77
suite.testAsync('Handle date objects as Date', async () => {
88
// Create a valid date timestamp first
99
const timestamp = Date.now()
10-
1110
// Create cross-realm date with the valid timestamp
1211
const crossRealmDate = await vm.runInNewContext(`new Date(${timestamp})`)
1312
assert(!(crossRealmDate instanceof Date))
14-
1513
// Create local date with same timestamp
1614
const date = new Date(timestamp)
17-
1815
const client = new helper.pg.Client()
1916
await client.connect()
2017
await client.query('CREATE TEMP TABLE foo(bar timestamptz, bar2 timestamptz)')
@@ -24,4 +21,4 @@ suite.testAsync('Handle date objects as Date', async () => {
2421
assert.deepStrictEqual(row.bar, date)
2522
assert.deepStrictEqual(row.bar2, date)
2623
await client.end()
27-
})
24+
})

0 commit comments

Comments
 (0)