mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
test(cron): expand parseAbsoluteTimeMs test coverage to 39 cases
This commit is contained in:
@@ -175,13 +175,8 @@ describe("parseAbsoluteTimeMs", () => {
|
||||
expect(parseAbsoluteTimeMs("")).toBeNull();
|
||||
});
|
||||
|
||||
it("accepts lenient ISO date formats that JavaScript supports", () => {
|
||||
// JavaScript Date.parse accepts some non-standard but unambiguous formats
|
||||
// "2024-1-15" with single-digit month is parsed successfully
|
||||
const result = parseAbsoluteTimeMs("2024-1-15");
|
||||
expect(result).not.toBeNull();
|
||||
// Should normalize to standard ISO format behavior
|
||||
expect(result).toBeGreaterThan(0);
|
||||
it("rejects non-padded ISO-like date formats", () => {
|
||||
expect(parseAbsoluteTimeMs("2024-1-15")).toBeNull();
|
||||
});
|
||||
|
||||
it("rejects incomplete datetime strings", () => {
|
||||
|
||||
Reference in New Issue
Block a user