Skip to content

Commit ea97e0a

Browse files
committed
Add missing cleanups
1 parent dd416c4 commit ea97e0a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Tests/AsyncAwait/ChatAsyncIntegrationTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,14 @@ class ChatAsyncIntegrationTests: BaseAsyncIntegrationTestCase {
196196
let channel = try await chat.createChannel(id: randomString(), name: "ChannelName")
197197
let retrievedChannel = try await chat.getChannel(channelId: channel.id)
198198

199-
XCTAssertEqual(retrievedChannel?.id, channel.id)
199+
XCTAssertEqual(
200+
retrievedChannel?.id,
201+
channel.id
202+
)
203+
204+
addTeardownBlock { [unowned self] in
205+
_ = try? await chat.deleteChannel(id: channel.id)
206+
}
200207
}
201208

202209
func testChatAsync_GetChannels() async throws {

Tests/ChatIntegrationTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,15 @@ class ChatIntegrationTests: BaseClosureIntegrationTestCase {
346346
)
347347
}
348348

349+
addTeardownBlock { [unowned self] in
350+
try awaitResultValue {
351+
chat.deleteChannel(
352+
id: channel.id,
353+
completion: $0
354+
)
355+
}
356+
}
357+
349358
XCTAssertEqual(retrievedChannel?.id, channel.id)
350359
}
351360

0 commit comments

Comments
 (0)