feat: add JD mother living time endpoint
This commit is contained in:
parent
1b0665c0f8
commit
33bdce4ba2
5 changed files with 62 additions and 2 deletions
17
server-tools/tcs-mother-body/living-time.test.mjs
Normal file
17
server-tools/tcs-mother-body/living-time.test.mjs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { livingTime } from "./living-time.mjs";
|
||||
|
||||
test("birth boundary is era day one", () => {
|
||||
const value = livingTime(Date.parse("2025-04-25T16:00:00.000Z"));
|
||||
assert.equal(value.world.era_day, 1);
|
||||
assert.equal(value.world.elapsed_milliseconds, 0);
|
||||
});
|
||||
|
||||
test("milliseconds advance without wake counter", () => {
|
||||
const first = livingTime(Date.parse("2026-09-09T00:00:00.000Z"));
|
||||
const second = livingTime(Date.parse("2026-09-09T00:00:00.017Z"));
|
||||
assert.equal(second.world.elapsed_milliseconds - first.world.elapsed_milliseconds, 17);
|
||||
assert.equal(second.clock.stored_tick_counter, false);
|
||||
assert.equal(second.clock.persona_wake_required, false);
|
||||
});
|
||||
Loading…
Reference in a new issue