You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-5Lines changed: 20 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,10 @@ A micro-framework for [_Table Driven Tests_](https://github.com/golang/go/wiki/T
16
16
## Features
17
17
18
18
- ☑️ Dead simple syntax
19
-
- ☑️ Run async tests in parallel
19
+
- ☑️ Run sync and async tests in parallel
20
20
- ☑️ No additional dependency aside from XCTest
21
-
- ☑️ Use with Quick, or any other XCTest-based testing framework
22
-
- ☑️ Fully tested
21
+
- ☑️ Use with [Quick](https://github.com/Quick/Quick), or any other XCTest-based testing frameworks
22
+
- ☑️ Fully tested itself
23
23
24
24
## Installation
25
25
@@ -46,6 +46,8 @@ github "akkyie/Tablier"
46
46
47
47
## Usage
48
48
49
+
### Synchronous Recipe
50
+
49
51
You can define a _test recipe_ to test your classes, structs or functions.
50
52
51
53
```swift
@@ -72,7 +74,9 @@ Then you can list inputs and expected outputs for the recipe, to run the actual
72
74
}
73
75
```
74
76
75
-
Defining a recipe with async functions is also supported.
77
+
### Asynchronous Recipe
78
+
79
+
Defining a recipe with an asynchronous completion is also supported.
76
80
77
81
```swift
78
82
let recipe = Recipe<String, Int>(async: { input, complete in
@@ -82,9 +86,20 @@ let recipe = Recipe<String, Int>(async: { input, complete in
82
86
})
83
87
```
84
88
89
+
Since Swift 5.5, you can use `AsyncRecipe` to define asynchronous recipes with async/await syntax:
90
+
91
+
```swift
92
+
let recipe = AsyncRecipe<String, Int> { input in
93
+
tryawaitmyComplexAndSlowParse(input)
94
+
}
95
+
```
96
+
85
97
#### Note
86
98
87
-
When an error is thrown in the sync initalizer or the completion handler is called with an error, the test case is considered as failed for now. Testing errors will be supported in the future.
99
+
> **Note**
100
+
>
101
+
> When an error is thrown in the sync initalizer or the completion handler is called with an error, the test case is considered as failed for now.
0 commit comments