Skip to content

Commit 011bd32

Browse files
committed
Add tests for toDateFromClockTime
1 parent be7da06 commit 011bd32

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/datetime/toDateFromClockTime.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { UTCDate, UTCDateMini } from "@date-fns/utc";
12
import { Temporal } from "@js-temporal/polyfill";
23
import { lightFormat } from "date-fns";
34
import { expect, test } from "vitest";
@@ -40,3 +41,12 @@ test("timezone", () => {
4041
);
4142
expect(lightFormat(date, "yyyy-MM-dd HH:mm:ss")).toBe("2023-03-12 02:30:00");
4243
});
44+
45+
test("date constructor type", () => {
46+
expect(
47+
toDateFromClockTime(Temporal.Now.plainDateISO(), UTCDate),
48+
).toBeInstanceOf(UTCDate);
49+
expect(toDateFromClockTime(Temporal.Now.plainDateISO())).toBeInstanceOf(
50+
UTCDateMini,
51+
);
52+
});

0 commit comments

Comments
 (0)