1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:47:35 +00:00

LibJS: Add Temporal.Instant.from()

This commit is contained in:
Idan Horowitz 2021-07-11 21:19:19 +03:00 committed by Linus Groh
parent 33cf6274e8
commit 84403ab423
3 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,17 @@
describe("correct behavior", () => {
test("length is 1", () => {
expect(Temporal.Instant.from).toHaveLength(1);
});
test("Instant instance argument", () => {
const instant = new Temporal.Instant(123n);
expect(Temporal.Instant.from(instant).epochNanoseconds).toBe(123n);
});
// Un-skip once ParseISODateTime & ParseTemporalTimeZoneString are implemented
test.skip("Instant string argument", () => {
expect(Temporal.Instant.from("1975-02-02T14:25:36.123456789Z").epochNanoseconds).toBe(
160583136123456789n
);
});
});