Skip to content

Commit 8604a33

Browse files
authored
Add async support to test traits (#384)
* Add async support to `prepareDependencies` and test traits * Only introduce trait
1 parent a501eeb commit 8604a33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/DependenciesTestSupport/TestTrait.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#if compiler(>=6.1)
77
@_documentation(visibility: private)
88
public struct _DependenciesTrait: TestScoping, TestTrait, SuiteTrait {
9-
let updateValues: @Sendable (inout DependencyValues) throws -> Void
9+
let updateValues: @Sendable (inout DependencyValues) async throws -> Void
1010

1111
@TaskLocal static var isRoot = true
1212

@@ -20,7 +20,7 @@
2020
if Self.isRoot {
2121
$0 = DependencyValues()
2222
}
23-
try updateValues(&$0)
23+
try await updateValues(&$0)
2424
} operation: {
2525
try await Self.$isRoot.withValue(false) {
2626
try await function()
@@ -123,7 +123,7 @@
123123
/// ```
124124
///
125125
public static func dependencies(
126-
_ updateValues: @escaping @Sendable (inout DependencyValues) throws -> Void
126+
_ updateValues: @escaping @Sendable (inout DependencyValues) async throws -> Void
127127
) -> Self {
128128
Self(updateValues: updateValues)
129129
}

0 commit comments

Comments
 (0)