@async-fn/jest
Version:
Additional methods to jest.fn to introduce "late resolve" of promises returned by mock functions. This allows tests that read chronologically, like a story.
9 lines (5 loc) • 377 B
Plain Text
@async-fn/jest
Late-resolve async mocks for Jest. `asyncFn()` returns a `jest.fn()`-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