Skip to content

Commit 8a1bb33

Browse files
committed
simplify tests
1 parent 322365e commit 8a1bb33

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Tests/AWSLambdaRuntimeTests/LambdaRuntimeTests.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,19 @@ struct LambdaRuntimeTests {
5757
try await runtime2.run()
5858
}
5959

60-
// get the first result (should be a LambdaRuntimeError)
61-
let error1 = try await #require(throws: (any Error).self) {
60+
// get the first result (should throw a LambdaRuntimeError)
61+
try await #require(throws: LambdaRuntimeError.self) {
6262
try await taskGroup.next()
6363
}
6464

6565
// cancel the other task
6666
taskGroup.cancelAll()
6767

68-
// get the second result (should be a ChannelError)
69-
let error2 = try await #require(throws: (any Error).self) {
68+
// get the second result (should throw a ChannelError)
69+
try await #require(throws: ChannelError.self) {
7070
try await taskGroup.next()
7171
}
7272

73-
#expect(error1 is LambdaRuntimeError, "First runtime should throw LambdaRuntimeError")
74-
#expect(error2 is ChannelError, "Second runtime should throw ChannelError")
7573
}
7674

7775
// wait a small amount to ensure everything is cancelled and cleanup

0 commit comments

Comments
 (0)