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

LibJS: Implement Temporal.PlainMonthDay.prototype.monthCode

This commit is contained in:
Linus Groh 2021-08-15 00:40:49 +01:00
parent 1382be1707
commit 9551aa17d3
3 changed files with 33 additions and 0 deletions

View file

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