Skip to main content
Use the spyOn utility to track method calls with Bun’s test runner.

Once the spy is created, it can be used to write expect assertions relating to method calls.

See Docs > Test Runner > Mocks for complete documentation on mocking with the Bun test runner.