UNPKG

@async-fn/sinon

Version:

Additional methods to sinon.spy to introduce "late resolve" of promises returned by mock functions. This allows tests that read chronologically, like a story.

9 lines (5 loc) 381 B
# @async-fn/sinon > Late-resolve async mocks for Sinon. `asyncFn()` returns a `sinon.spy()`-compatible mock whose returned promise resolves from the test body, after the system under test has called it. This lets tests read chronologically. ## Documentation - [LLM Usage](./LLM_USAGE.md): compact API reference with examples - [README](./README.md): full tutorial and rationale