mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:37:45 +00:00
LibJS: Add Temporal.Instant.prototype.equals()
This commit is contained in:
parent
84403ab423
commit
2382f67e0b
4 changed files with 41 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
|||
describe("correct behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
const instant1 = new Temporal.Instant(111n);
|
||||
expect(instant1.equals(instant1));
|
||||
const instant2 = new Temporal.Instant(999n);
|
||||
expect(!instant1.equals(instant2));
|
||||
});
|
||||
});
|
||||
|
||||
test("errors", () => {
|
||||
test("this value must be a Temporal.Instant object", () => {
|
||||
expect(() => {
|
||||
Temporal.Instant.prototype.equals.call("foo", 1, 2);
|
||||
}).toThrowWithMessage(TypeError, "Not a Temporal.Instant");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue