mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
fix(docs): correct mock documentation examples (#25384)
## Summary - Fix `mock.mock.args` to `mock.mock.calls` in mock-functions.mdx (the `.args` property doesn't exist) - Fix mock.restore example to use module methods instead of spy functions (calling spy functions after restore returns `undefined`) - Add missing `vi` import in Vitest compatibility example ## Test plan - [x] Verified each code block works by running tests against the debug build 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -60,7 +60,7 @@ test("random", async () => {
|
||||
|
||||
expect(random).toHaveBeenCalled();
|
||||
expect(random).toHaveBeenCalledTimes(3);
|
||||
expect(random.mock.args).toEqual([[1], [2], [3]]);
|
||||
expect(random.mock.calls).toEqual([[1], [2], [3]]);
|
||||
expect(random.mock.results[0]).toEqual({ type: "return", value: a });
|
||||
});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user