Hacker News new | ask | show | jobs
Show HN: SwiftMock – automatic mock generation for Swift (swiftmock.com)
1 points by gokulnair2001 145 days ago
Hi HN SwiftMock is a lightweight CLI tool that generates mock implementations for Swift protocols.

The idea is to remove the repetitive boilerplate involved in writing mocks by hand, especially as protocols grow larger and start using async/await, throwing functions, and complex method signatures.

The tool scans the codebase, identifies mockable protocols, and produces deterministic mock classes that support call tracking, argument capture, and customizable behavior for tests.

It’s written entirely in Swift, has no runtime dependencies, and is designed to be easy to integrate into existing build or CI workflows.

GitHub: https://github.com/gokulnair2001/SwiftMock

Feedback and suggestions are very welcome.