Skip to content

Commit 7414a6e

Browse files
author
Andreas Günther
committed
ADD readme content
1 parent fda3bb7 commit 7414a6e

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
11
# SwiftAsyncAssert
22

3-
XCTAssert variants to evaluate async expressions in XCTests.
3+
Assert functions to evaluate Swift concurrency async expressions in XCTests.
4+
5+
> The Missing concurrency functions in `XCTest` framework
6+
7+
---
8+
9+
Instead of writing
10+
11+
```swift
12+
import XCTest
13+
14+
func test_should_succeed() async
15+
do {
16+
let isTrue = try await shouldSucceed()
17+
XCTAssertTrue(isTrue)
18+
} catch {
19+
XCFail("Should not throw an error")
20+
}
21+
}
22+
```
23+
24+
conveniently write
25+
26+
```swift
27+
import SwiftAsyncAssert
28+
29+
func test_should_succeed() async
30+
await AsyncAssertTrue(try await shouldSucceed())
31+
}
32+
33+
func test_should_throwError() async
34+
await AsyncAssertThrowsError(try await shouldFail())
35+
}
36+
```
37+
38+
Less code for your convenience when testing!

0 commit comments

Comments
 (0)