Skip to content

Commit

Permalink
Explicitly use new Date()
Browse files Browse the repository at this point in the history
  • Loading branch information
carlopi committed Jun 17, 2024
1 parent bd7b7d8 commit b658106
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/duckdb-wasm/test/regression/github_393.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function test393(db: () => duckdb.AsyncDuckDB): void {
const resultWithoutCast = await conn.query<{
ts: arrow.TimestampMillisecond;
}>(`SELECT TIMESTAMP '1992-03-22 01:02:03' as ts`);
expect(resultWithoutCast.toArray()[0]?.ts).toEqual(new Date(Date.UTC(1992, 2, 22, 1, 2, 3)).getTime());
expect(new Date(resultWithoutCast.toArray()[0]?.ts)).toEqual(new Date(Date.UTC(1992, 2, 22, 1, 2, 3)));

await db().open({
path: ':memory:',
Expand All @@ -39,7 +39,7 @@ export function test393(db: () => duckdb.AsyncDuckDB): void {
const resultWithCast = await conn.query<{
ts: arrow.DateMillisecond;
}>(`SELECT TIMESTAMP '1992-03-22 01:02:03' as ts`);
expect(resultWithCast.toArray()[0]?.ts).toEqual(new Date(Date.UTC(1992, 2, 22, 1, 2, 3)));
expect(new Date(resultWithCast.toArray()[0]?.ts)).toEqual(new Date(Date.UTC(1992, 2, 22, 1, 2, 3)));
});
});
}

0 comments on commit b658106

Please sign in to comment.