mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibJS: Implement Date.prototype.toTemporalInstant
This commit is contained in:
parent
8e8c133db5
commit
511029807a
Notes:
github-actions[bot]
2024-11-26 21:57:38 +00:00
Author: https://github.com/trflynn89
Commit: 511029807a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2594
4 changed files with 39 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
describe("correct behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
const date = new Date("2021-07-09T01:36:00Z");
|
||||
const instant = date.toTemporalInstant();
|
||||
expect(instant.epochMilliseconds).toBe(1625794560000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("this value must be a Date object", () => {
|
||||
expect(() => {
|
||||
Date.prototype.toTemporalInstant.call(123);
|
||||
}).toThrowWithMessage(TypeError, "Not an object of type Date");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue