Skip to content

feat: support yielding intercepted calls - #4

Merged
cayasde merged 2 commits into
mainfrom
agent/intercept-yield-support
Jul 30, 2026
Merged

feat: support yielding intercepted calls#4
cayasde merged 2 commits into
mainfrom
agent/intercept-yield-support

Conversation

@cayasde

@cayasde cayasde commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Allow mock.capture, mock.respond, and mock.release to wait through yields from the controlled callback or released original method.
  • Add coverage for yields before capture, between captured calls, after release, and asynchronous callback errors.
  • Document the yielding contract and add a minor Changeset.

Why

Tests must be able to control code that legitimately uses task.wait() without replacing its timing behavior through dependency injection.

Impact

Controlled interception operations can now yield when the code under test yields. Test runners must support yielding tests in those cases.

Validation

npm run check

npm test

@cayasde
cayasde marked this pull request as ready for review July 30, 2026 14:53
@cayasde
cayasde merged commit cbc6cee into main Jul 30, 2026
1 check passed
@cayasde
cayasde deleted the agent/intercept-yield-support branch July 30, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant