Updated the documentation at the README file in the project.
This commit is contained in:
@@ -31,7 +31,7 @@ let package = Package(
|
||||
It is also possible to use this library with your app in Xcode by adding it as a dependency in your Xcode project.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Swift 5.10 or higher is required in order to build this library.
|
||||
> Swift 6.2 or higher is required in order to build this library.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -83,7 +83,7 @@ let service = AmiiboService(
|
||||
|
||||
## Testing
|
||||
|
||||
The `AmiiboClient` protocol enables creating custom mock clients for unit testing without network calls. Conform to `AmiiboClient` and inject it into `AmiiboService` via its `init(client:)` initializer:
|
||||
The `AmiiboClient` protocol enables creating custom mock clients for unit testing without network calls. Conform to `AmiiboClient` and inject it into `AmiiboService` via its `init(client:)` initializer. Since `AmiiboClient` refines `Sendable`, conforming types must be safe to share across concurrency domains:
|
||||
|
||||
```swift
|
||||
import AmiiboService
|
||||
@@ -104,6 +104,16 @@ struct MyMockClient: AmiiboClient {
|
||||
let service = AmiiboService(client: MyMockClient())
|
||||
```
|
||||
|
||||
### Running the test suite
|
||||
|
||||
The unit tests based on a mock client run offline by default. The tests against the live service are skipped unless the `AMIIBO_LIVE_TESTS` environment variable is set to `1`, either in the environment when testing from the command line:
|
||||
|
||||
```shell
|
||||
AMIIBO_LIVE_TESTS=1 swift test
|
||||
```
|
||||
|
||||
or in the `Test` action of the scheme when testing from Xcode.
|
||||
|
||||
## Documentation
|
||||
|
||||
Please refer to the [online documentation](https://rock-n-code.github.io/amiibo-service/documentation/amiiboservice/) for further information about this library.
|
||||
|
||||
Reference in New Issue
Block a user