mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:27:35 +00:00
LibJS: Implement Temporal.PlainDateTime.prototype.withPlainDate
This commit is contained in:
parent
f657c86d58
commit
010761aff4
7 changed files with 80 additions and 0 deletions
|
@ -0,0 +1,17 @@
|
|||
describe("correct behavior", () => {
|
||||
test("length is 1", () => {
|
||||
expect(Temporal.PlainDateTime.prototype.withPlainDate).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
const firstPlainDateTime = new Temporal.PlainDateTime(1, 2, 3, 4, 5, 6);
|
||||
const plainDate = new Temporal.PlainDate(7, 8, 9);
|
||||
const secondPlainDateTime = firstPlainDateTime.withPlainDate(plainDate);
|
||||
expect(secondPlainDateTime.year).toBe(7);
|
||||
expect(secondPlainDateTime.month).toBe(8);
|
||||
expect(secondPlainDateTime.day).toBe(9);
|
||||
expect(secondPlainDateTime.hour).toBe(4);
|
||||
expect(secondPlainDateTime.minute).toBe(5);
|
||||
expect(secondPlainDateTime.second).toBe(6);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue