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

LibJS: Implement Temporal.Duration.prototype.years

This commit is contained in:
Linus Groh 2021-07-15 23:34:53 +01:00
parent 23766f28db
commit 300a22f9b9
4 changed files with 48 additions and 1 deletions

View file

@ -0,0 +1,14 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const duration = new Temporal.Duration(123);
expect(duration.years).toBe(123);
});
});
test("errors", () => {
test("this value must be a Temporal.Duration object", () => {
expect(() => {
Reflect.get(Temporal.Duration.prototype, "years", "foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.Duration");
});
});