Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLeif authored Nov 7, 2024
1 parent a18d9b4 commit 1447b11
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Mocked is a Swift 6 compiler macro that automatically generates mock implementat
- **Configurable Behavior**: Easily override behavior by providing closures during initialization of the mock.
- **Support for Associated Types**: The `Mocked` macro handles protocols with associated types using generics.
- **Automatic Detection of Class Requirements**: If the protocol conforms to `AnyObject`, a class is generated instead of a struct, maintaining reference semantics.
- **Automatic Default Property Implementations**: Properties are backed by straightforward storage for easy access and modification.

## Installation

Expand Down Expand Up @@ -133,6 +134,12 @@ XCTAssertTrue(isValid)
- **Unimplemented Methods**: Any method that is not overridden will call `fatalError()` if invoked. Ensure all required methods are implemented when using the generated mock.
- **Async and Throwing Methods**: The generated mocks handle `async` and `throws` methods appropriately, but be sure to provide closures that match the method signatures.

## Limitations

- **No Function-Level Generics**: Generics are supported only at the protocol level using associated types. Function-level generics are not currently supported. If you need generic capabilities, consider using associated types in the protocol.
- **Child Protocols Cannot Mock Parent Requirements**: When mocking protocols that inherit from other protocols, the `@Mocked` macro will not automatically generate implementations for the inherited protocol requirements.
- **No Support for `@` Annotations**: Attributes such as `@MainActor` are not currently supported in mock generation.

## Contributing

Contributions are welcome! If you have suggestions, issues, or improvements, feel free to open a pull request or issue on the [GitHub repository](https://github.com/0xLeif/Mocked).
Expand Down

0 comments on commit 1447b11

Please sign in to comment.