mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:17:36 +00:00
LibJS: Implement Temporal.PlainDateTime.prototype.year
This commit is contained in:
parent
667124dc22
commit
23d0fd2659
3 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
describe("correct behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
const plainDateTime = new Temporal.PlainDateTime(2021, 7, 29);
|
||||
expect(plainDateTime.year).toBe(2021);
|
||||
});
|
||||
});
|
||||
|
||||
test("errors", () => {
|
||||
test("this value must be a Temporal.PlainDateTime object", () => {
|
||||
expect(() => {
|
||||
Reflect.get(Temporal.PlainDateTime.prototype, "year", "foo");
|
||||
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainDateTime");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue