File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Tests/AWSLambdaEventsTests Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
15
- import XCTest
15
+ import Foundation
16
+ import Testing
16
17
17
18
@testable import AWSLambdaEvents
18
19
19
- class APIGatewayWebSocketsTests : XCTestCase {
20
+ @Suite
21
+ class APIGatewayWebSocketsTests {
20
22
static let exampleConnectEventBody = """
21
23
{
22
24
" headers " : {
@@ -65,14 +67,12 @@ class APIGatewayWebSocketsTests: XCTestCase {
65
67
// MARK: - Request -
66
68
67
69
// MARK: Decoding
68
-
69
- func testRequestDecodingExampleConnectRequest( ) {
70
+ @Test func testRequestDecodingExampleConnectRequest( ) async throws {
70
71
let data = APIGatewayWebSocketsTests . exampleConnectEventBody. data ( using: . utf8) !
71
- var req : APIGatewayWebSocketRequest ?
72
- XCTAssertNoThrow ( req = try JSONDecoder ( ) . decode ( APIGatewayWebSocketRequest . self, from: data) )
72
+ let req = try JSONDecoder ( ) . decode ( APIGatewayWebSocketRequest . self, from: data)
73
73
74
- XCTAssertEqual ( req? . context. routeKey, " $connect " )
75
- XCTAssertEqual ( req? . context. connectionId, " IU3kkeN4IAMCJwA= " )
76
- XCTAssertNil ( req? . body)
74
+ #expect ( req. context. routeKey == " $connect " )
75
+ #expect ( req. context. connectionId == " IU3kkeN4IAMCJwA= " )
76
+ #expect ( req. body == nil )
77
77
}
78
78
}
You can’t perform that action at this time.
0 commit comments