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

LibJS: Implement Temporal.Duration.prototype.blank

This commit is contained in:
Linus Groh 2021-07-16 00:15:56 +01:00
parent 3713164fa3
commit a06b034a9a
4 changed files with 40 additions and 0 deletions

View file

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