fix(parser-native): harden native parser test edge cases

This commit is contained in:
digua committed 2026-07-05 22:49:38 +08:00
1 parent c0548f63c8
commit 312a0306cb
5 files changed
+282 -55

No files matched your search

+2 -2
View File
@@ -38,8 +38,8 @@ describe('parseTimeOptions', () => {
})
it('accepts "YYYY-MM-DD HH:mm" and full ISO 8601', () => {
const range = parseTimeOptions({ since: '2026-06-01 08:30', until: '2026-06-01T10:00:00+08:00' }, NOW)
assert.equal(range.startTs, localEpoch(2026, 6, 1, 8, 30))
const range = parseTimeOptions({ since: '2026-05-31 08:30', until: '2026-06-01T10:00:00+08:00' }, NOW)
assert.equal(range.startTs, localEpoch(2026, 5, 31, 8, 30))
assert.equal(range.endTs, Math.floor(new Date('2026-06-01T10:00:00+08:00').getTime() / 1000))
})