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

LibJS: Implement Temporal.PlainDateTime.prototype.monthCode

This commit is contained in:
Idan Horowitz 2021-07-29 23:58:55 +03:00 committed by Linus Groh
parent 78e63b34fa
commit 677a631e87
3 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,14 @@
describe("correct behavior", () => {
test("basic functionality", () => {
const plainDateTime = new Temporal.PlainDateTime(2021, 7, 29);
expect(plainDateTime.monthCode).toBe("M07");
});
});
test("errors", () => {
test("this value must be a Temporal.PlainDateTime object", () => {
expect(() => {
Reflect.get(Temporal.PlainDateTime.prototype, "monthCode", "foo");
}).toThrowWithMessage(TypeError, "Not a Temporal.PlainDateTime");
});
});