Repository navigation
test(core): add unit tests for createPermitDeadline - #337
Conversation
|
The latest CI attempt for Build and secret scan passed; the full Test step was skipped. This finding is based on the current diff and CI log, not a local test run. |
dmae97
left a comment
There was a problem hiding this comment.
Thanks for adding these. All 6 tests pass locally, and the behavior they check matches createPermitDeadline.
CI is failing at the Check step (build-check-test) because of two Biome errors:
lint/style/useConstat line 72:let t = 0is never reassigned, so it should beconst;- formatting at about line 30:
() => createPermitDeadline(100, () => {}, () => value)needs to be split across lines.
Running npx biome check --write packages/coding-agent/test/permit-deadline.test.ts fixes both.
Optional: the function's doc comment also promises that delays longer than the 32-bit timer limit (2_147_483_647 ms) are split into chunks, and no test covers that yet. A fake-timer test for it would be a nice addition.
|
Rechecked The new CI run 42204086001 is |
Pin validation, clock-driven expiry, re-arming on lag, and cancel semantics for the monotonic queue deadline. Closes dmae97#329
9cf20c9 to
efbbbaf
Compare
|
Rechecked The remaining validation blocker is CI run 42283918523: |
|
CI status update for The checkout log identifies merge tree |
|
CI attempt 3 now passes Build, Check, and Test, including all seven The passing checkout is still |
Consolidate unit tests for createPermitDeadline, incorporating explicit RangeError type/message checks and >32-bit timer chunking from dmae97#337 alongside default clock operation and re-arm-through-expiration tests. Supersedes dmae97#337 Fixes dmae97#329 Co-authored-by: Sudhakar <[email protected]>
1.5.13 이후 main에 병합된 사용자 영향 수정(dmae97#393, Anthropic OAuth의 Claude Code identity 2.1.322)을 7개 workspace 패키지 1.5.14로 발행한다. 릴리스 노트에 이번 주기 외부 기여자(dmae97#337, dmae97#400, dmae97#410, dmae97#412, dmae97#413)를 적고 그 아래 AdaptOrch 소개를 둔다.
…s for createPermitDeadline Add incremental test coverage for createPermitDeadline on top of dmae97#337: - Test negative-infinite duration input (-Infinity) - Follow early timer re-arm through actual expiration - Test default performance.now() clock operation Fixes dmae97#329
Summary
Adds unit tests for
createPermitDeadlineinpackages/coding-agent/src/core/permit-deadline.ts, which currently has no dedicated test coverage. The function takes an injectable clock, making it straightforward to test without real waiting.Changes
packages/coding-agent/test/permit-deadline.test.ts(new): 6 tests covering:RangeErrorfor non-positive/non-finite durationsRangeErrorfor non-finite clock values at startexpired()follows the injected clockonExpireruns exactly once on expiry (fake timers)cancel()preventsonExpirefrom runningTesting
Result: 1 test file, 6 tests passed.
Related
Checklist