bun-test-mocking

Installation
SKILL.md

Bun Test Mocking

Bun provides Jest-compatible mocking with mock(), spyOn(), and module mocking.

Mock Functions

import { test, expect, mock } from "bun:test";

// Create mock function
const fn = mock(() => "original");

test("mock function", () => {
  fn("arg1", "arg2");

  expect(fn).toHaveBeenCalled();
  expect(fn).toHaveBeenCalledTimes(1);
  expect(fn).toHaveBeenCalledWith("arg1", "arg2");
});
Related skills

More from secondsky/claude-skills

Installs
94
GitHub Stars
143
First Seen
Apr 3, 2026