import XCTest func assertEqualAsync<T>( _ actual: @autoclosure () async -> T, _ expected: T, _ message: String = "", file: StaticString = #filePath, line: UInt = #line ) async where T : Equatable { let actual = await actual() XCTAssertEqual(actual, expected, message, file: file, line: line) }
呼び出し方↓ await assertEqualAsync(await self.viewMock.stopIndicatorCallCount, 1)
ぎぎにゃんさんの Crossroad を参考にしましたm( )m@MainActor
を付けたら不要になりました…笑)