mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:57:35 +00:00
LibJS: Implement Temporal.Duration.prototype.blank
This commit is contained in:
parent
3713164fa3
commit
a06b034a9a
4 changed files with 40 additions and 0 deletions
|
@ -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");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue