File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
docs/architecture/mobile-clients/ios Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 7171Serilog
7272signtool
7373signup
74+ Sourcery
7475sqlcmd
7576struct
7677structs
Original file line number Diff line number Diff line change @@ -444,3 +444,27 @@ This makes it convenient to switch between these files or open them side-by-side
444444 mode, dark mode, and with a large dynamic type size. ⚠️ These tests are done using an ** iPhone 15
445445 Pro (17.0.1)** simulator, otherwise tests may fail because of subtle differences between iOS
446446 versions.
447+
448+ ### Mocks generation
449+
450+ We use [ Sourcery] ( https://github.com/krzysztofzablocki/Sourcery ) for automatic mock generation.
451+
452+ In order to automatically generate a mock from a protocol, just add a comment with
453+ ` // sourcery: AutoMockable ` to such protocol, perform a build and the mock will be automatically
454+ generated and added to the ` AutoMockable.generated.swift ` file.
455+
456+ For example:
457+
458+ ``` swift
459+ protocol FooProtocol { // sourcery: AutoMockable
460+ func bar () -> Bool
461+ }
462+ ```
463+
464+ :::info Manual generation
465+
466+ There are some cases where the automatically generated mock does not cover the mock scenario we want
467+ or it cannot handle some closure types, specially in function's parameters. In such cases prefer
468+ create the mock manually and remove the protocol's comment as ` AutoMockable ` .
469+
470+ :::
You can’t perform that action at this time.
0 commit comments