mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:37:46 +00:00
LibJS: Implement Temporal.TimeZone.prototype.getPreviousTransition()
This commit is contained in:
parent
e9cbeeac45
commit
92fdae178b
6 changed files with 63 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 1", () => {
|
||||
expect(Temporal.TimeZone.prototype.getPreviousTransition).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instant = new Temporal.Instant(0n);
|
||||
expect(timeZone.getPreviousTransition(instant)).toBeNull();
|
||||
});
|
||||
|
||||
test("custom offset", () => {
|
||||
const timeZone = new Temporal.TimeZone("+01:30");
|
||||
const instant = new Temporal.Instant(0n);
|
||||
expect(timeZone.getPreviousTransition(instant)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("this value must be a Temporal.TimeZone object", () => {
|
||||
expect(() => {
|
||||
Temporal.TimeZone.prototype.getPreviousTransition.call("foo");
|
||||
}).toThrowWithMessage(TypeError, "Not an object of type Temporal.TimeZone");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue